[Bug c/107100] -fanalyzer false positive about leak in function with attribute((malloc)) obtained from another function with attribute((malloc(free,1)))

2022-09-30 Thread eblake at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107100 --- Comment #1 from Eric Blake --- Might be a dup of bug#101648

[Bug c/107100] New: -fanalyzer false positive about leak in function with attribute((malloc)) obtained from another function with attribute((malloc(free,1)))

2022-09-30 Thread eblake at redhat dot com via Gcc-bugs
: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Target Milestone: --- I'm at a loss for why disabling -O2

[Bug c/91688] New: -Woverride-init could use an intermediate mode of operation

2019-09-06 Thread eblake at redhat dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Target Milestone: --- Right now, -Woverride-init is so strong that it interferes with the use of gcc's extension of ranged-array initializer syntax as a common way

[Bug c/89990] request warning: Use of out of bound compound initialised struct

2019-04-05 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89990 --- Comment #1 from Eric Blake --- Other references to compound initializers going out of scope and causing problems: https://stackoverflow.com/questions/47691857/lifetime-of-a-compound-literal

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270 --- Comment #5 from Eric Blake --- For what it's worth, POSIX requires syslog() to support %m, and this is the case even on BSD systems. So a new __attribute__((format(syslog, x, y))) archetype would be an easy way of at least notating functions

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270 --- Comment #3 from Eric Blake --- Confirmed that -Wpendantic flags %m: $ gcc -Wpedantic -Wformat foo.c -o foo foo.c: In function ‘main’: foo.c:3:10: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] printf("%m %B\n");

[Bug c/88270] -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88270 --- Comment #1 from Eric Blake --- Note that gcc -Wformat DOES flag things like printf("%B"), %m is the only special-case where it is not flagged even on systems where it does not work, and where we'd want fine-tuned control over whether a

[Bug c/88270] New: -Wformat-XXX option for flagging %m

2018-11-29 Thread eblake at redhat dot com
Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Target Milestone: --- I was working porting a project originally written for Linux over to BSD systems, and had to fix code that called printf("%m") to spell out longhand printf("%s", strerro

[Bug c/80060] New: RFE: -Wformat knob to ignore same-width incorrect types

2017-03-15 Thread eblake at redhat dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Target Milestone: --- When porting from one machine to another, especially when porting from 32-bit to 64-bit software, getting warnings about mismatches such as printf

[Bug c/69602] [6/7 Regression] over-ambitious logical-op warning on EAGAIN vs EWOULDBLOCK

2017-01-24 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 --- Comment #15 from Eric Blake --- (In reply to Martin Sebor from comment #14) > I would suggest to keep the warning simple and avoid overdesigning it with > workarounds for this case. The solution in comment #12 (copied below) seems > like a

[Bug c/69602] New: over-ambitious logical-op warning on EAGAIN vs EWOULDBLOCK

2016-02-01 Thread eblake at redhat dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Target Milestone: --- POSIX says that EAGAIN and EWOULDBLOCK may be identical, but also that they may be distinct. Therefore, well-written portable code MUST check

[Bug c/65446] Improve -Wformat-signedness

2015-05-21 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65446 Eric Blake eblake at redhat dot com changed: What|Removed |Added CC||eblake at redhat

[Bug c/66249] New: -Wformat-signedness should not warn on enums

2015-05-21 Thread eblake at redhat dot com
Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Target Milestone: --- The standard is clear that enums have implementation-defined signedness (C99 6.7.2.2P4 Each enumerated type shall be compatible with char, a signed integer type, or an unsigned

[Bug c/65446] Improve -Wformat-signedness

2015-05-21 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65446 --- Comment #3 from Eric Blake eblake at redhat dot com --- see also bug 66249 where the implementation-defined signedness of enums comes into play, and where I argue that neither %d nor %u should warn when an enum type is passed through varargs

[Bug c/60194] -Wformat should also warn when using %d (instead of %u) for unsigned arguments

2015-05-21 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60194 Eric Blake eblake at redhat dot com changed: What|Removed |Added CC||eblake at redhat

[Bug c/65446] Improve -Wformat-signedness

2015-05-21 Thread eblake at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65446 --- Comment #4 from Eric Blake eblake at redhat dot com --- Arguably, %u with short should warn, while %hu with short should not. On the other hand, if I use %hu with int, it is unclear to me whether I should get a warning (the fact that I'm

[Bug c/58488] -Wuninitialized is useless for a variable whose address is later taken

2013-09-23 Thread eblake at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58488 --- Comment #3 from Eric Blake eblake at redhat dot com --- Since the engine is able to warn at -O0 when I _don't_ take the address, I don't see why the warning is lost by the mere action of taking the address.

[Bug c/58488] New: -Wuninitialized is useless for a variable whose address is later taken

2013-09-20 Thread eblake at redhat dot com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eblake at redhat dot com Here's a simple example of where -Wuninitialized is rather useless at default optimization: $ cat foo.c #include stdlib.h int main(void) { char *oops

[Bug c/57475] incompatible pointer type message is not helpful enough

2013-05-31 Thread eblake at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57475 --- Comment #3 from Eric Blake eblake at redhat dot com --- (In reply to Manuel López-Ibáñez from comment #1) We could detect the special case where the spelling is the same and report where each type is declared. Be aware that spelled the same