typedef in preprocessor macros

Guido Flohr gufl0000@stud.uni-sb.de
Thu Jul 1 17:54:00 GMT 1999


Hi,

the info documentation to egcs-2.90.29 gives this code example as a safe
macro:

#define max(a,b) \
  ({typedef _ta = (a), _tb =(b); \
    _ta _a = a; _tb _b = b; \
    _a > _b ? _a : _b; })

The above mentioned egcs -Wall will compile about "type defaults to `int'
in declaration of _ta" (and the same for `_tb').  The same already happens
with gcc 2.8.1 but not with gcc 2.7.2.

Who is wrong? The docs or the compiler?

Thank you!

Guido
-- 
http://stud.uni-sb.de/~gufl0000
mailto:gufl0000@stud.uni-sb.de


More information about the Gcc-bugs mailing list