public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ishikawa at yk dot rim.or.jp" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/109041] Bogus compile time check by __builtin_memset? error: ‘__builtin_memset’ writing 4 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
Date: Wed, 08 Mar 2023 05:11:05 +0000	[thread overview]
Message-ID: <bug-109041-4-0salvu83RE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109041-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from ishikawa,chiaki <ishikawa at yk dot rim.or.jp> ---
Right, when I replaced gcc-11 with gcc-12 in my script, I got the following
warnings. One of them was there before, the other is new.

/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)
      |                                          ^~
/tmp/sqlite3-preprocessed-2.c: In function ‘vtabCallConstructor’:
/tmp/sqlite3-preprocessed-2.c:121095:4: error: the comparison will always
evaluate as ‘true’ for the address of ‘pVtabCtx’ will never be NULL
[-Werror=address]
121095 |  ) ? (void) (0) : __assert_fail (
       |    ^
/tmp/sqlite3-preprocessed-2.c:5226:12: note: ‘pVtabCtx’ declared here
 5226 |   VtabCtx *pVtabCtx;
      |            ^~~~~~~~
cc1: all warnings being treated as errors


The latter one is a new one. Not sure why it was not triggered with gcc-11.

Anyway, actually, I have found out that there is a runtime assertion triggered
by thunderbird mail client when it is compiled with gcc-12, and not with
gcc-10|gcc-11.
So, I wanted to check the source code as much as possible with -Werror before I
dive into runtime code generation issues.
"-Werror" signals so many dubious constructs, and it has been an uphill battle
to make the code compile.
I found a missing "break" statement (implicit fallthrough), and strange size
check (3rd argument to strncpy) already, but  I am close to being able to
compile mozilla source tree with more compile time check right now.

Thank you again for making advanced compiler available free of charge.

  parent reply	other threads:[~2023-03-08  5:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 11:16 [Bug c/109041] New: " ishikawa at yk dot rim.or.jp
2023-03-06 16:40 ` [Bug tree-optimization/109041] " pinskia at gcc dot gnu.org
2023-03-07 15:52 ` ishikawa at yk dot rim.or.jp
2023-03-07 15:56 ` pinskia at gcc dot gnu.org
2023-03-08  1:14 ` pinskia at gcc dot gnu.org
2023-03-08  5:11 ` ishikawa at yk dot rim.or.jp [this message]
2023-03-08 10:02 ` marxin at gcc dot gnu.org
2023-03-08 15:52 ` ishikawa at yk dot rim.or.jp
2023-03-08 15:55 ` ishikawa at yk dot rim.or.jp
2023-03-09 11:09 ` marxin at gcc dot gnu.org
2023-03-10 14:49 ` ishikawa at yk dot rim.or.jp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109041-4-0salvu83RE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).