casts to a type other than an integral or enumeration type in a constant-expression
Andreas Schwab
schwab@suse.de
Wed Feb 12 20:53:00 GMT 2003
Fred Fish <fnf@public.ninemoons.com> writes:
|> The latest eCos sources no longer build with the latest gcc. The
|> problem can be tracked down to C++ code like the following in eCos:
|>
|> #include <signal.h>
|>
|> void foo (__sighandler_t __sighdl)
|> {
|> switch ((int) __sighdl)
|> {
|> case (int) SIG_DFL:
|> ;
|> case (int) SIG_IGN:
|> ;
|> }
|> }
This code is completely bogus anyway, even if it might be valid. Casting
a pointer to int is dubious at best and will fail miserably if sizeof
(__sighandler_t) > sizeof (int).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Gcc-bugs
mailing list