This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
typedef in preprocessor macros
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: typedef in preprocessor macros
- From: "Guido Flohr" <gufl0000 at stud dot uni-sb dot de>
- Date: Fri, 2 Jul 1999 02:17:22 +0200
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