https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124141
Bug ID: 124141
Summary: Bogus -Wdangling-pointer in SQLite source code
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: boris at kolpackov dot net
Target Milestone: ---
Compiling sqlite3.c from the 3.51.2 release (latest at the time of this
submission) with GCC 16 -O3 -Wall produces -Wdangling-pointer that look bogus
to me:
$ gcc-16 -c -O3 -Wall sqlite3.c
In function ‘applyNumericAffinity’,
inlined from ‘sqlite3_value_numeric_type’ at sqlite3.c:95730:5,
inlined from ‘sqlite3_value_numeric_type’ at sqlite3.c:95726:16:
sqlite3.c:95653:15: warning: dangling pointer to ‘rValue’ may be used
[-Wdangling-pointer=]
95653 | pRec->u.r = rValue;
| ~~~~~~~~~~^~~~~~~~
sqlite3.c: In function ‘sqlite3_value_numeric_type’:
sqlite3.c:95644:10: note: ‘rValue’ declared here
95644 | double rValue;
| ^~~~~~
Note that there are no such warning if compiling with GCC 15.