Hello,
I am delighted you found contributing to GCC interesting. Sorry for the
delay in replying.
I am adding the GCC mailing list in case other GCC developers have
something to add to my reply. It is usually a good idea to email the
list and not an individual, if only because most of the commu
The following can be a possible example of a case where the analyzer fails
to understand POSIX file-descriptor API.
- - -
#include
#include
void test()
{
int fd;
fd = open("foo.txt", O_RDONLY | O_CREAT);
}
void test_2()
{
FILE *f;
f = fopen("demo.c", "r");
}
godbolt link: http
The %m format specifier is a documented feature of syslog, but gcc gives a
warning when -Wpedantic is used. Is this a bug?
For example, the program:
#include
int main(void)
{
syslog(LOG_ERR, "%m");
return 0;
}
gives:
warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=]
> On 25-Jan-2022, at 9:38 AM, Kris Andersen via Gcc wrote:
>
> The %m format specifier is a documented feature of syslog, but gcc gives a
> warning when -Wpedantic is used. Is this a bug?
>
> For example, the program:
>
> #include
> int main(void)
> {
>syslog(LOG_ERR, "%m");
>return