This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
attribute(format) in c++
- To: egcs-bugs at cygnus dot com
- Subject: attribute(format) in c++
- From: "Alexander V. Lukyanov" <lav at yars dot free dot net>
- Date: Wed, 29 Apr 1998 14:34:52 +0400
Hi!
I noticed that printf format in c++ is not checked as it is in plain C.
Example:
struct a
{
void x(char *f,...) __attribute__((format(printf,2,3)));
};
main()
{
a A;
A.x("%d");
return 0;
}
And g++ -Wall does not produce any warning. Verified with egcs-1.0.2 and
gcc-2.7.2.2
Alexander.