https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115274

            Bug ID: 115274
           Summary: Bogus -Wstringop-overread in SQLite source code
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: boris at kolpackov dot net
  Target Milestone: ---

Compiled attached sqlite3.c from recent SQLite release with GCC 14 and -O3
produces the following bogus (according to our analysis) warning:

$ gcc-14 -O3 -c sqlite3.c
In function ‘sqlite3Strlen30’,
    inlined from ‘sqlite3ColumnSetColl’ at sqlite3.c:115936:10:
sqlite3.c:33361:28: warning: ‘strlen’ reading 1 or more bytes from a region of
size 0 [-Wstringop-overread]
33361 |   return 0x3fffffff & (int)strlen(z);
      |                            ^~~~~~~~~
In function ‘sqlite3ColumnSetColl’:
cc1: note: source object is likely at address zero

$ gcc-14 --version
gcc-14 (Debian 14.1.0-1) 14.1.0

There is no such warning with GCC 13.2.0.

Reply via email to