help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: insert-header-preprocessor-definition


From: Ben Bacarisse
Subject: Re: insert-header-preprocessor-definition
Date: Wed, 11 Apr 2018 21:56:28 +0100

Emanuel Berg <address@hidden> writes:

> Ben Bacarisse wrote:
>
>> this common construction can give rise to C's
>> dreaded "undefined behaviour". All sorts of
>> macro names are reserved to the
>> implementation depending on what headers have
>> been included in the source file that
>> includes this one.
>>
>> It's common to ignore this rule, but if you
>> are providing a facility for general use it
>> might be better to follow letter of the law.
>> Pre-pending "H_" to the label is known to
>> be safe.
>
> I agree. So for color.c, color.h should have
> H_COLOR_H?

That is safe, yes.  Doing it by hand, I think most people write H_COLOR
but you can't even be sure there will be a .h in the name!  Actually, I
like the symmetry, now that I see it, and I may use this myself.

<snip>
-- 
Ben.


reply via email to

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