From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13219 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: internal header proposal Date: Mon, 10 Sep 2018 01:27:20 +0300 (MSK) Message-ID: References: <20180907172312.GO1878@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1536531931 10101 195.159.176.226 (9 Sep 2018 22:25:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2018 22:25:31 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) To: musl@lists.openwall.com Original-X-From: musl-return-13235-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 10 00:25:27 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fz88x-0002So-5w for gllmg-musl@m.gmane.org; Mon, 10 Sep 2018 00:25:23 +0200 Original-Received: (qmail 31805 invoked by uid 550); 9 Sep 2018 22:27:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 31787 invoked from network); 9 Sep 2018 22:27:31 -0000 In-Reply-To: <20180907172312.GO1878@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:13219 Archived-At: 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