|
Message-ID: <20210419152300.GR2546@brightrain.aerifal.cx> Date: Mon, 19 Apr 2021 11:23:00 -0400 From: Rich Felker <dalias@...c.org> To: Jon Chesterfield <jonathanchesterfield@...il.com> Cc: musl@...ts.openwall.com Subject: Re: 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
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.