[Bug c/107802] -Wsuggest-attribute=format ignores [[gnu::format(...)]]
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 22 19:11:53 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107802
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |c
Keywords| |ice-checking,
| |ice-on-valid-code
Last reconfirmed| |2022-11-22
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Well Looks like it ICEs on the trunk with -Wsuggest-attribute=format -W -Wall :
```
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
[[gnu::format(printf, 1, 2)]]
void raise(
const char* assertionMessage,
...)
{
va_list args;
va_start(args, assertionMessage);
vfprintf(stderr, assertionMessage, args);
va_end(args);
abort();
}
void f(void)
{
raise("%s", 1223);
}
```
With both the C and C++ front-ends.
Confirmed.
More information about the Gcc-bugs
mailing list