This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Possible variadic macro bug
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: Possible variadic macro bug
- From: seebs at plethora dot net (Peter Seebach)
- Date: Fri, 09 Nov 2001 17:07:06 -0600
- cc: gcc-bugs at gcc dot gnu dot org
- Reply-To: seebs at plethora dot net (Peter Seebach)
In message <20011109225516.A22521@daikokuya.demon.co.uk>, Neil Booth writes:
>> >> While I'm at it, the documentation for ISO's __VA_ARGS__ in extend.texi
>> >> is misleading. While it's true that, given
>> >> #define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
>> >> you can't omit the comma, you *could* write
>> >> #define debug(format ...) fprintf(stderr, format __VA_ARGS__)
>> >> in C99, and then the comma is optional. (See 6.10.3, paragraph 10, for
>> >> the description.)
>>
>> >Have you tried it?
>>
>> I'm just saying it's correct ISO C99. I haven't tried it, because I don't
>> have an ISO C99 compiler. :) It would be good for the docs to show how
>> to do this using the C99 varargs macro stuff, though; as is, it sounds like
>> they're saying you *can't* do that in the ISO C stuff.
>It's not correct C99 - C99 requires that arguments be comma separated,
>including the "...".
Oops! Rereading this, I see what you're saying. I noticed the existance of
the (...) form, and didn't think this through correctly. Sorry! Hmm. I'm
still convinced we *meant* to make this possible, though. Ugh.
-s