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]
Other format: [Raw text]

[Bug c/22476] -Wmissing-format-attribute should pick out function pointer candidates also


------- 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


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