RE: Bug#152709: gcc: __VA_ARGS__ stringification crashes preproce ssor if __VA_ARGS__ is empty
variable arguments in macros?? Is it standard?!?
> -----Original Message-----
> From: Daniel Webb [mailto:webb@robust.colorado.edu]
> Sent: Friday, July 12, 2002 10:00 AM
> To: debian-bugs-dist@lists.debian.org
> Cc: Debian GCC maintainers; gcc-defaults@packages.qa.debian.org
> Subject: Bug#152709: gcc: __VA_ARGS__ stringification crashes
> preprocessor if __VA_ARGS__ is empty
>
>
> Package: gcc
> Version: 2:2.95.4-14
> Severity: normal
>
>
> -- System Information
> Debian Release: 3.0
> Kernel Version: Linux robust.colorado.edu 2.4.17 #1 SMP Sun
> Apr 21 21:05:15 MDT 2002 i686 unknown
>
> Versions of the packages gcc depends on:
> ii cpp 2.95.4-14 The GNU C preprocessor.
> ii cpp-2.95 2.95.4-7 The GNU C preprocessor.
> ii gcc-2.95 2.95.4-7 The GNU C compiler.
>
> Example code:
> ------------------------------
> #define ASSERT(test_expression, ...) \
> if (! (test_expression)) \
> { \
> fprintf(stderr, "Assertion failed: "
> #test_expression "\n"); \
> fprintf(stderr, #__VA_ARGS__); \
> fprintf(stderr, "Function trace:\n"); \
> exit(1); \
> }
>
> int main(void)
> {
> ASSERT(1>0);
> printf("run_tests(): Assertion failure.\n");
> ASSERT(0>1, "Test completed successfully.");
>
> return 0;
> }
> ------------------------------
>
> >gcc compiler_error.c
> gcc: Internal compiler error: program cpp0 got fatal signal 11
>
>
>
>
> --
> To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
>
--
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: