Sujet : Re: Block Comments Or Rest-Of-Line Comments?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 22. Mar 2024, 17:33:18
Autres entêtes
Organisation : None to speak of
Message-ID : <87h6gyz0oh.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
James Kuyper <
jameskuyper@alumni.caltech.edu> writes:
On 3/21/24 15:23, Keith Thompson wrote:
Richard Harnden <richard.nospam@gmail.invalid> writes:
[...]
And sometimes, when it's not a really a comment, but rather a block of
code I don't want right now:
>
#ifdef 0
...
#endif
I think you mean "#if 0".
>
I'm sure he did. However, I'd like to mention that I have occasionally
used #ifdef with a macro name that I haven't #defined, and have no plans
to #define, but which describes the reason why I'm commenting this
section out. This is purely to document my reason, but should I ever
change my mind, I can simply #define the corresponding macro.
Just to be clear, the problem with "#ifdef 0" is that 0 is not an
identifier.
main.c:1:8: error: macro names must be identifiers
1 | #ifdef 0
| ^
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comWorking, but not speaking, for Medtronicvoid Void(void) { Void(); } /* The recursive call of the void */