This is the mail archive of the gcc-bugs@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]

c/1017: -Wmissing-format-attribute gives too many warnings



>Number:         1017
>Category:       c
>Synopsis:       -Wmissing-format-attribute gives too many warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 08 09:46:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Jaeger
>Release:        2.97 20001208 (experimental)
>Organization:
SuSE
>Environment:
System: Linux gromit 2.4.0-test10 #52 Wed Nov 1 08:06:34 CET 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /cvs/gcc/configure --prefix=/opt/gcc-2.97.test --enable-shared --enable-threads=posix --with-gnu-as --with-gnu-ld --disable-nls --enable-languages=c,objc,c++,f77
>Description:
	The program appended below warns IMO erroneously:
	gromit:/tmp:[1]$ /opt/gcc-2.97.test/bin/gcc -Wmissing-format-attribute -c t.c -Wformat
t.c: In function `test':
t.c:7: warning: function might be possible candidate for `printf' format attribute

	
>How-To-Repeat:

Compile this small program with -Wmissing-format-attribute -Wformat:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extern void dbg_log (const char *str, ...)
     __attribute__ ((__format__ (__printf__, 1, 0)));

int
test (void)
{
  dbg_log ("%s:", "Test");

  return 0;
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:

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