From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6734 invoked from network); 19 Apr 2021 15:23:18 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 19 Apr 2021 15:23:18 -0000 Received: (qmail 15573 invoked by uid 550); 19 Apr 2021 15:23:13 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 15555 invoked from network); 19 Apr 2021 15:23:12 -0000 Date: Mon, 19 Apr 2021 11:23:00 -0400 From: Rich Felker To: Jon Chesterfield Cc: musl@lists.openwall.com Message-ID: <20210419152300.GR2546@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Requirements on code in libc headers On Mon, Apr 19, 2021 at 09:05:20AM +0100, Jon Chesterfield wrote: > Hello musl, > > I find myself implementing printf on a GPU without much compiler support. > That's broadly working, if a bit macro + inline function themed. The intent > is to eventually have all of musl running on the asic but that's a long > game. > > Does anyone have a reference, or know offhand, what one is supposed to do > for libc implementation code that lives in a header file? > > So far I have static inline on implementation functions and am putting > __leading __underscores on function and variable names. There's not a conforming way to make the standard library functions entirely inline in headers, because they're required external functions with a unique address. But assuming you don't care about that for your purposes, yes, using only identifiers in the reserved namespace (leading double underscore is the "most reserved" one and probably best choice). So it sounds like you're on a good track. Rich