This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

parse errors in netinet/in.h


I am using gcc 3.3 on x86_64 with -O3 on SusE.

For my application, the line #259 in netinet/in.h
gets preprocessed to

# 259 "/usr/include/netinet/in.h" 3 4
extern uint32_t
(__builtin_constant_p((__u32)((uint32_t __netlong))) ?
({ __u32 __x = (((uint32_t __netlong))); ((__u32)(
(((__u32)(__x) & (__u32)0x000000ffUL) << 24) |
(((__u32)(__x) & (__u32)0x0000ff00UL) << 8) |
(((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) |
(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) :
__fswab32(((uint32_t __netlong)))) __attribute__
((__const__));
extern uint16_t
(__builtin_constant_p((__u16)((uint16_t __netshort)))
? ({ __u16 __x = (((uint16_t __netshort))); ((__u16)(
(((__u16)(__x) & (__u16)0x00ffU) << 8) |
(((__u16)(__x) & (__u16)0xff00U) >> 8) )); }) :
__fswab16(((uint16_t __netshort))))
     __attribute__ ((__const__));

and then it flashes parse errors.

The errors go away if include the header early in the
sequence.
I examined this and found that this is happening
because both __GNUC__ >=3 and OPTIMIZE macros are
getting true for this case. The errors go away if I
use -std=c99, since GCC stops using __builtin in that
case.

The problem is somewhat related to the following
thread
http://lists.debian.org/debian-devel/2001/03/msg01392.html

What's the correct solution for this?

Thanks
--skg



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


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