Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 10 Sep 2018 01:27:20 +0300 (MSK)
From: Alexander Monakov <>
Subject: Re: internal header proposal

I've written the following response a couple of days ago (before seeing your
more recent follow-up), but it bounced due to disk space issues.

On Fri, 7 Sep 2018, Rich Felker wrote:
> Option 1: The big fancy header wrapping

This looks nice to me, except ...

> If we
> wanted, at some point we could even #define the unprefixed names to
> remap to the prefixed ones, and only #undef them in the files that
> define them, so that everything automatically gets the namespace-safe,
> low-call-overhead names.

... for this: I have reservations about such #defines. Preprocessing
works on a wrong level to have such redirections as general policy (e.g.
if redirections are done via function-like macros, their effect won't
apply when taking the address). It creates an unnecessary distraction
for people inspecting generated asm ("hm, where did this __ prefix came
from?"), and I can imagine it causing problems for debugging (e.g. if
one wanted to breakpoint on strchrnul in libc built with LTO, they'd
be surprised to see their breakpoint didn't hit and they needed to
breakpoint on __strchrnul instead).

> Option 2: New namespaced.h header

Just want to remark that internal/libc.h already hosts a few such
declarations, so it might make sense to either grow the kitchen sink
further or aim to dismantle it altogether.

Thank you for writing this up!


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.