public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21962] New: [bogus warning] format '%012llx' expects type X, but argument has type X
@ 2005-06-08 14:55 pluto at agmk dot net
  2005-06-08 15:04 ` [Bug c/21962] 4.0/4.1 Regression] ] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pluto at agmk dot net @ 2005-06-08 14:55 UTC (permalink / raw)
  To: gcc-bugs

extern void print(const char *my_format, ...)
__attribute__((format(printf, 1, 2)));

typedef struct {
    unsigned long long family:8, id:48, crc:8;
} bar;

void foo(bar *x)
{
    print("%012llx\n", x->id);
}


$ gcc  testcase.c -c -Wall
testcase.c: In function 'foo':
testcase.c:9: warning: format '%012llx' expects type 'long long unsigned int',
                       but argument 2 has type 'long long unsigned int'

$ gcc -v
Reading specs from /usr/lib/gcc/i686-pld-linux/4.0.1/specs
Target: i686-pld-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-languages=c,c++,f95,objc,ada,java --enable-c99 --enable-long-long
--disable-multilib --enable-nls --with-gnu-as --with-gnu-ld
--with-demangler-in-ld --with-system-zlib --with-slibdir=/lib --without-x
--enable-cmath --enable-libgcj --enable-libgcj-multifile
--enable-libgcj-database --enable-gtk-cairo i686-pld-linux
Thread model: posix
gcc version 4.0.1 20050521 (prerelease) (PLD Linux)

-- 
           Summary: [bogus warning] format '%012llx' expects type X, but
                    argument has type X
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pld-linux
  GCC host triplet: i686-pld-linux
GCC target triplet: i686-pld-linux


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-12  4:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-08 14:55 [Bug c/21962] New: [bogus warning] format '%012llx' expects type X, but argument has type X pluto at agmk dot net
2005-06-08 15:04 ` [Bug c/21962] 4.0/4.1 Regression] ] " pinskia at gcc dot gnu dot org
2005-06-08 16:32 ` joseph at codesourcery dot com
2005-07-12  4:18 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).