warning: `x' might be used uninitialised in this function
Giuliano Procida
GProcida@madge.com
Wed Mar 31 23:54:00 GMT 1999
Here is an example which shows the problem.
// cc -O -Wuninitialized -c test3.c -o test3.o
typedef unsigned short u16;
typedef unsigned short __u16;
typedef unsigned int __u32;
typedef unsigned int u32;
typedef struct {
u32 vc; // comment this line out and you get no warnings!
u32 flags;
u32 rate;
} command;
static __inline__ __const__ __u16 ___arch__swab16(__u16 y) {
__asm__("xchgb %b0,%h0" : "=q" (y) : "0" (y));
return y;
}
extern __inline__ __const__ __u16 __fswab16(__u16 x) {
return ___arch__swab16( x ) ;
}
int main (void) {
u16 tx_rate_bits;
u16 tx_vc_bits;
command cmd;
cmd.flags = (__builtin_constant_p((__u16)(tx_vc_bits))
? ((__u16)( (((__u16)(tx_vc_bits) & (__u16)0x00ffU) << 8) |
(((__u16)(tx_vc_bits) & (__u16)0xff00U) >> 8) ))
: __fswab16(tx_vc_bits)) ;
cmd.rate = (__builtin_constant_p((__u16)(tx_rate_bits))
? ((__u16)( (((__u16)(tx_rate_bits) & (__u16)0x00ffU) << 8) |
(((__u16)(tx_rate_bits) & (__u16)0xff00U) >> 8) ))
: __fswab16(tx_rate_bits)) ;
return 0;
}
Giuliano.
--
gprocida@madge.com
myxie@debian.org
More information about the Gcc-bugs
mailing list