[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] Re: include-once-only macros

From: Paul Eggert
Subject: Re: [Bug-gnulib] Re: include-once-only macros
Date: Tue, 28 Sep 2004 09:48:29 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Simon Josefsson <address@hidden> writes:

> I thought that POSIX (or C99?) implied user code shouldn't use CPP
> symbols that began with '_'?

C99 reserves all identifiers that begin with an underscore and either
an uppercase letter or another underscore, for any use.  (Some other
identifiers are also reserved, in some contexts.)

Hence _FOO_H is not portable C99 code; applications are supposed to
use FOO_H.

gnulib is in a bit of a weird state, since it's sort of an
"application" (subject to the above rules), and sort of a "library"
(thus it shouldn't infringe on the application space more than
necessary, and so it _should_ use names like _FOO_H).

Personally I think of gnulib more as an "application", since it's
intended to be dropped directly into application code.  So I prefer
FOO_H to _FOO_H.  But I'm not dogmatic about it.

> Does, for example, SVR4/Solaris then define DS_H?

No, Solaris uses e.g., "#ifndef _STDIO_H".  But it has to use _[A-Z]
symbols, since it is part of the implementation.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]