From: Ben Bacarisse <ben.usenet@bsb.me.uk>
To: help-gnu-emacs@gnu.org
Subject: Re: insert-header-preprocessor-definition
Date: Sun, 15 Apr 2018 22:10:22 +0100 [thread overview]
Message-ID: <87vacsnpkx.fsf@bsb.me.uk> (raw)
In-Reply-To: 86a7u49sa7.fsf@zoho.com
Emanuel Berg <moasen@zoho.com> writes:
> Ben Bacarisse wrote:
>
>> The C standard lists, for every header, any
>> patterns of macro names that are reserved to
>> the implementation. errno.h, for example,
>> reserves all macro names that start
>> E followed by a digit or another upper case
>> latter. Thus a program that uses ERROR_H
>> whilst also including errno.h is technically
>> undefined even if errno.h does not actually
>> use that macro name.
>>
>> None of the headers reserve any names that
>> start H_
>
> Right, but what about stuff that aren't part of
> the C standard library?
I'm not sure what to say about that. That's a well-known problem with
no ideal solution. And what might be a suitable non-ideal solution
will, most likely, vary from project to project.
But if more and more people use H_ to start guards, that will become a
de-facto standard and will discourage the use of H_ names for other
uses.
Alternatively, you could use a standard-C safe prefix that is very
unlikely to be used by anything else:
#ifdef Emanuel_Berg_EMACS_GENERATED_GUARD_FOR_COLOR_H
(Em... is not reserved by errno.h)
--
Ben.
next prev parent reply other threads:[~2018-04-15 21:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <86fu429udy.fsf@zoho.com>
2018-04-11 15:47 ` insert-header-preprocessor-definition Ben Bacarisse
2018-04-11 20:41 ` insert-header-preprocessor-definition Emanuel Berg
2018-04-11 20:56 ` insert-header-preprocessor-definition Ben Bacarisse
2018-04-11 22:07 ` insert-header-preprocessor-definition Emanuel Berg
2018-04-14 23:54 ` insert-header-preprocessor-definition Emanuel Berg
2018-04-15 1:02 ` insert-header-preprocessor-definition Ben Bacarisse
2018-04-15 7:44 ` insert-header-preprocessor-definition Yuri Khan
2018-04-15 19:35 ` insert-header-preprocessor-definition Emanuel Berg
2018-04-15 21:10 ` Ben Bacarisse [this message]
2018-04-15 21:45 ` insert-header-preprocessor-definition Emanuel Berg
[not found] ` <mailman.12420.1523778312.27995.help-gnu-emacs@gnu.org>
2018-04-15 19:46 ` insert-header-preprocessor-definition Emanuel Berg
2018-04-16 5:35 ` insert-header-preprocessor-definition Yuri Khan
[not found] ` <mailman.12486.1523856961.27995.help-gnu-emacs@gnu.org>
2018-04-16 6:16 ` insert-header-preprocessor-definition Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vacsnpkx.fsf@bsb.me.uk \
--to=ben.usenet@bsb.me.uk \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.