mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: internal header proposal
Date: Mon, 10 Sep 2018 01:27:20 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.20.13.1809100125410.28763@monopod.intra.ispras.ru> (raw)
In-Reply-To: <20180907172312.GO1878@brightrain.aerifal.cx>

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!

Alexander


  parent reply	other threads:[~2018-09-09 22:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 17:23 Rich Felker
2018-09-08  3:27 ` Rich Felker
2018-09-09 22:27 ` Alexander Monakov [this message]
2018-09-10  0:47   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.20.13.1809100125410.28763@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).