[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: insert-header-preprocessor-definition
From: |
Emanuel Berg |
Subject: |
Re: insert-header-preprocessor-definition |
Date: |
Wed, 11 Apr 2018 22:41:22 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
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?
>> (beg-string (concat
>> (format "#ifndef %s\n" label)
>> (format "#define %s\n\n" label) ))
>
> I'd probably write
>
> (concat "#ifndef " label "\n"
> "#define " label "\n\n")
OK!
--
underground experts united
http://user.it.uu.se/~embe8573
- 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 <=
- 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, 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