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

--- Comment #6 from ishikawa,chiaki <ishikawa at yk dot rim.or.jp> ---
Created attachment 54610
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54610&action=edit
The script to produce the warning in the original report with gcc-11.

The source file needs to be in /tmp/sqlite3-preprocessed-2.c

Run this script with
bash this-script and it will print something like this on my linux PC.

Here I put the script into t83.sh:

bash ~/Dropbox/TB-DIR/WALL-PATCH-DIR/t83.sh
/tmp/sqlite3-preprocessed-2.c: In function ‘posixUnlock’:
/tmp/sqlite3-preprocessed-2.c:22632:42: error: self-comparison always evaluates
to true [-Werror=tautological-compare]
22632 |                      sqlite3PendingByte+1==(sqlite3PendingByte+1)
      |                                          ^~
In function ‘memset’,
    inlined from ‘pager_playback’ at /tmp/sqlite3-preprocessed-2.c:32113:4:
/tmp/sqlite3-preprocessed-2.c:4273:10: error: ‘__builtin_memset’ writing 4
bytes into a region of size 0 overflows the destination
[-Werror=stringop-overflow=]
 4273 |   return __builtin___memset_chk (__dest, __ch, __len,
__builtin_object_size (__dest, 0));
      |         
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/sqlite3-preprocessed-2.c: In function ‘pager_playback’:
/tmp/sqlite3-preprocessed-2.c:32089:30: note: destination object
‘*pPager.pTmpSpace’ of size [0, 9223372036854775807]
32089 |     zSuper = (void *) &pPager->pTmpSpace[4];
      |                        ~~~~~~^~~~~~~~~~~
/tmp/sqlite3-preprocessed-2.c:32089:30: note: destination object
‘*pPager.pTmpSpace’ of size [0, 9223372036854775807]
cc1: all warnings being treated as errors
ishikawa@ip030:/NREF-COMM-CENTRAL/mozilla$

Reply via email to