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]

attribute(format) in c++


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.


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