This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22476] -Wmissing-format-attribute should pick out function pointer candidates also
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jul 2005 18:49:17 -0000
- Subject: [Bug c/22476] -Wmissing-format-attribute should pick out function pointer candidates also
- References: <20050714044824.22476.ghazi@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ghazi at gcc dot gnu dot org 2005-07-14 18:49 -------
Here's another case we should catch, passing a function pointer as a parameter:
#include <stdio.h>
static void foo (int (*ptr)(const char *, ...))
{
ptr("hello world %d\n", 5L);
}
int main (void)
{
foo (printf);
return 0;
}
In this code GCC should see that the argument 'ptr' to function 'foo' is being
passed something with a format attribute set. I suspect this is handled
elsewhere in the compiler than the assignment operator in my first example.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22476