[Bug c/33873] New: Bad printf warning for bitfield
ian at airs dot com
gcc-bugzilla@gcc.gnu.org
Tue Oct 23 18:54:00 GMT 2007
Consider this C code:
#include <stdio.h>
typedef long long int int64;
typedef long long unsigned int uint64;
struct pointer {
uint64 data : 58;
uint64 tag : 6;
};
union value {
int64 i;
struct pointer p;
};
typedef union value Value;
void test(Value x) {
printf("%llu\n", x.p.data);
}
When I compile it with -Wall, I get
foo.c:20: warning: format Â%llu expects type Âlong long unsigned intÂ, but
argument 2 has type Âlong long unsigned int:58Â
The value is presumably going to be passed to printf as an unsigned long
long--what else could it be passed as? So this warning seems incorrect.
This may be related to PR 33819.
--
Summary: Bad printf warning for bitfield
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ian at airs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33873
More information about the Gcc-bugs
mailing list