mailing list of musl libc
 help / color / mirror / 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

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git