[Bug c/22421] problems with -Wformat and bit-fields

tony dot luck at intel dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 24 00:06:00 GMT 2006



------- Comment #10 from tony dot luck at intel dot com  2006-01-24 00:06 -------
Broken (again?) in 4.1

$ cat u.c
typedef unsigned long u64;

struct pal_freq_ratio {
        u64 den : 32, num : 32; /* numerator & denominator */
} x;

main()
{
        printf("den=%lx num=%lx\n", x.den, x.num);
}
$ cc -Wformat u.c
u.c:9: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 2
has type ‘unsigned int’
u.c:9: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3
has type ‘unsigned int’
$ cc --version
cc (GCC) 4.1.0 20060109 (prerelease) (SUSE Linux)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Should this be re-opened, or is it logged elsewhere?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22421



More information about the Gcc-bugs mailing list