This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28492] -Wmissing-format-attribute causes warning for vsnprintf()
- From: "bernard dot van dot duijnen at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Apr 2010 15:08:32 -0000
- Subject: [Bug c/28492] -Wmissing-format-attribute causes warning for vsnprintf()
- References: <bug-28492-13012@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from bernard dot van dot duijnen at oracle dot com 2010-04-04 15:08 -------
The message may be unclear, but is in itself correct.
Your function vsnprintf_one needs an annotation because
its first argument is a format string that can be checked itself
to be a valid format. As there are no arguments to compare to, the
first-to-check should be zero.
static void vsnprintf_one(char *self, va_list arglist)
__attribute__ ((format (printf, 1, 0)));
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28492