* standards for include guards?
@ 2001-05-17 7:43 Sam TH
2001-05-17 8:45 ` Fergus Henderson
2001-05-17 9:26 ` Mark Mitchell
0 siblings, 2 replies; 4+ messages in thread
From: Sam TH @ 2001-05-17 7:43 UTC (permalink / raw)
To: gcc
Without getting into a discussion on the merits of include guards in
GCC, is there some standard for naming such guards? With the help of
grep, I have found:
_FILENAME_EXT
GCC_FILENAME_EXT
__GCC_FILENAME_EXT__
_GCC_FILENAME_EXT
__FILENAME_EXT__
__filename_ext
FILENAME_EXT_INCLUDED
FILENAME_EXT
_FILENAME_EXT_
JV_FILENAME_EXT (in java/)
_DIR_FILENAME_EXT
_H_f_filename (in f/)
Then, the weird ones:
java/parse.h: JV_LANG_H
gstab.h: __GNU_STAB__
glimits.h: __LIMITS_H_
Maybe something should be picked?
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dynds.org/decss
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7A+dGt+kM0Mq9M/wRAt1EAJ4haEtZaamxZYaXlLzHra8iFv/DlgCfacdI
xwj+2EJxzALt1CMInPjQpbM=
=5j+T
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: standards for include guards?
2001-05-17 7:43 standards for include guards? Sam TH
@ 2001-05-17 8:45 ` Fergus Henderson
2001-05-17 9:26 ` Mark Mitchell
1 sibling, 0 replies; 4+ messages in thread
From: Fergus Henderson @ 2001-05-17 8:45 UTC (permalink / raw)
To: Sam TH, gcc
On 17-May-2001, Sam TH <sam@uchicago.edu> wrote:
> Without getting into a discussion on the merits of include guards in
> GCC, is there some standard for naming such guards?
This was discussed on gcc-patches a month or so ago, IIRC.
Unfortunately I wasn't able to find it via the search page.
> With the help of
> grep, I have found:
>
> _FILENAME_EXT
> GCC_FILENAME_EXT
> __GCC_FILENAME_EXT__
> _GCC_FILENAME_EXT
> __FILENAME_EXT__
> __filename_ext
> FILENAME_EXT_INCLUDED
> FILENAME_EXT
> _FILENAME_EXT_
> JV_FILENAME_EXT (in java/)
> _DIR_FILENAME_EXT
> _H_f_filename (in f/)
Names starting with `__' or `_[A-Z]' are reserved for use by the C
implementation. Standard library header files, and files which
are included in standard library header files, should use such names.
Other header files which are merely used in gcc (e.g. tree.h) should not.
I *think* the convention agreed on earlier was GCC_FILENAME_EXT.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh > | -- the last words of T. S. Garp.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: standards for include guards?
2001-05-17 7:43 standards for include guards? Sam TH
2001-05-17 8:45 ` Fergus Henderson
@ 2001-05-17 9:26 ` Mark Mitchell
2001-05-17 11:27 ` Sam TH
1 sibling, 1 reply; 4+ messages in thread
From: Mark Mitchell @ 2001-05-17 9:26 UTC (permalink / raw)
To: sam; +Cc: gcc
We should use this one:
GCC_FILENAME_EXT
Anything starting with an `_' is invalid for use in user code.
Anything not starting with `GCC' is likely-ish to be used somewhere
else.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-05-17 11:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-17 7:43 standards for include guards? Sam TH
2001-05-17 8:45 ` Fergus Henderson
2001-05-17 9:26 ` Mark Mitchell
2001-05-17 11:27 ` Sam TH
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 read-only IMAP folder(s) and NNTP newsgroup(s).