mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Requirements on code in libc headers
@ 2021-04-19  8:05 Jon Chesterfield
  2021-04-19 15:23 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Chesterfield @ 2021-04-19  8:05 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

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.

Thanks!

Jon

[-- Attachment #2: Type: text/html, Size: 777 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] Requirements on code in libc headers
  2021-04-19  8:05 [musl] Requirements on code in libc headers Jon Chesterfield
@ 2021-04-19 15:23 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2021-04-19 15:23 UTC (permalink / raw)
  To: Jon Chesterfield; +Cc: musl

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-19 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19  8:05 [musl] Requirements on code in libc headers Jon Chesterfield
2021-04-19 15:23 ` Rich Felker

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).