[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 <moasen@zoho.com> 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.
- insert-header-preprocessor-definition, Emanuel Berg, 2018/04/11
- Re: insert-header-preprocessor-definition, Ben Bacarisse, 2018/04/11
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/11
- Re: insert-header-preprocessor-definition,
Ben Bacarisse <=
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/11
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/14
- Re: insert-header-preprocessor-definition, Ben Bacarisse, 2018/04/14
- Re: insert-header-preprocessor-definition, Yuri Khan, 2018/04/15
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/15
- Re: insert-header-preprocessor-definition, Ben Bacarisse, 2018/04/15
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/15
- Message not available
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/15
- Re: insert-header-preprocessor-definition, Yuri Khan, 2018/04/16
- Message not available
- Re: insert-header-preprocessor-definition, Emanuel Berg, 2018/04/16