public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/108616] New: -Wanalyzer-allocation-size false negatives for use of "alloca" Date: Tue, 31 Jan 2023 17:09:06 +0000 [thread overview] Message-ID: <bug-108616-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108616 Bug ID: 108616 Summary: -Wanalyzer-allocation-size false negatives for use of "alloca" Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Target Milestone: --- Consider e.g. this bogusly-sized alloca: #include <alloca.h> #include <stdint.h> int main(void) { int length = 99; int32_t *arr = alloca(length); return 0; } No warning is emitted for -Wanalyzer-allocation-size with -fanalyzer: https://godbolt.org/z/eTjf6fTzE unless we use -Wsystem-headers: https://godbolt.org/z/oTKnG78ob due to alloca being a macro inside a system header to __builtin_alloca. We ought to warn for such cases; I have a fix under construction
next reply other threads:[~2023-01-31 17:09 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-31 17:09 dmalcolm at gcc dot gnu.org [this message] 2023-01-31 17:10 ` [Bug analyzer/108616] " dmalcolm at gcc dot gnu.org 2023-02-01 2:22 ` cvs-commit at gcc dot gnu.org 2023-02-01 2:30 ` dmalcolm at gcc dot gnu.org
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-108616-4@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: linkBe 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).