Bug#152709: gcc: __VA_ARGS__ stringification crashes preprocessor if __VA_ARGS__ is empty
tags 152709 + fixed
retitle 152709 [fixed in gcc-3.x] __VA_ARGS__ stringification crashes preprocessor if __VA_ARGS__ is empty
reassign 152709 gcc-2.95
thanks
Daniel Webb writes:
> 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: