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]

gcc 2.92.2 c++ warning 'too many arguments for format' invalid?



The attached program, when compiled using gcc 2.95.2 and the command
line given in the comment produces the warning message in the comment.
It also appears that under some circumstances, that I am unable to
reproduce yet, no bar.o file is produced.  Changing 'printf' to nearly
anything else seems to cause the warning message to go away.

Is this a compiler related bug?

Marty

-----     cut here for bar.cpp     -----
/*
g++ -Wall -g -c bar.cpp
bar.cpp: In function `void bar()':
bar.cpp:8: warning: too many arguments for format

Compilation finished at Tue Jan 25 16:20:59
*/

class foo {
public:
  static void printf(const char *f, ...);
};

void bar()
{
  foo::printf("hi", "test");
}
-----     end here for bar.cpp     -----

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