https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114609
Bug ID: 114609 Summary: -Waddress false positive Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: arnaud.lb at gmail dot com Target Milestone: --- The following code: ``` struct { int member; } state; int effect; void f(void) { effect = ((&state)->member == 1 ? &state : 0) ? 2 : 3; } ``` When compiled with: ``` gcc -c test.c -Waddress ``` Results in the following warning: ``` <source>: In function 'f': <source>:8:51: warning: the address of 'state' will always evaluate as 'true' [-Waddress] 8 | effect = ((&state)->member == 1 ? &state : 0) ? 2 : 3; | ^ Compiler returned: 0 ``` I believe this is a false positive, and no warning should be emitted. GCC version: 13.2.1 20240316 (Red Hat 13.2.1-7)