warning: '/*' within comment
D'Arcy J.M. Cain
darcy at druid.uucp
Mon Jun 4 22:52:20 AEST 1990
In article <13040 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>In article <1990Jun1.200433.6919 at druid.uucp> darcy at druid.UUCP (D'Arcy J.M. Cain) writes:
>>However I got the same warning. Is there anything in the standard that
>>allows the compiler to ignore the quotes while inside a comment.
> [...]
>My advice to you is to tell your compiler vendor that you don't
>appreciate gratuitous warning messages, and that
> /* stuff; /* comment */
>is a fairly common usage for avoiding code generation when the
>programmer wants to indication an operation that would normally
>be necessary, but fortuitously happens to be already taken care
>of in a particular case.
But I do appreciate it most of the time. The proper way to do what you
are suggesting is to use "#if 0" instead of a comment. What I want is
a way to tell the compiler that in this case I really mean what I am
saying so please don't warn me. It is sort of like the construct "if
(a = getval())" which may generate a warning. It's a good warning and
can be avoided by "if ((a = getval()) != 0)" if you really mean it.
I considered using the "#if 0" construct to handle my example but that
would probably mean closing the regular comment and reopening it after the
#endif. I am sure that the compiler would ignore any #if statement in
a comment.
--
D'Arcy J.M. Cain (darcy at druid) | Government:
D'Arcy Cain Consulting | Organized crime with an attitude
West Hill, Ontario, Canada |
(416) 281-6094 |
More information about the Comp.std.c
mailing list