This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: casts to a type other than an integral or enumeration type in aconstant-expression


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."

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]