public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "hv at crypt dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102329] pointer "maybe uninitialized" right after assignment Date: Wed, 15 Sep 2021 03:50:33 +0000 [thread overview] Message-ID: <bug-102329-4-zgG7Fqg2Tt@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102329-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102329 --- Comment #2 from Hugo van der Sanden <hv at crypt dot org> --- I guess this is justified by the second paragraph of the -Wmaybe-uninitialized docs: "In addition, passing a pointer (or in C++, a reference) to an uninitialized object to a const-qualified function argument is also diagnosed by this warning." Firstly, I'd request for this case that the wording of the diagnostic should clarify that it's the data pointed to that may be used uninitialized rather than the pointer itself. Secondly, I think there's a case to be made that 'const void *' should specifically be exempt from this warning: that a void* is not "a pointer to an object". (The specific call in the original code was to pthread_getspecific(); it seems reasonable that it should take a 'const void *' as its second argument.)
next prev parent reply other threads:[~2021-09-15 3:50 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-14 16:49 [Bug c/102329] New: " hv at crypt dot org 2021-09-14 16:56 ` [Bug c/102329] " jakub at gcc dot gnu.org 2021-09-15 3:50 ` hv at crypt dot org [this message] 2021-09-15 7:55 ` [Bug tree-optimization/102329] " rguenth at gcc dot gnu.org 2021-09-15 15:44 ` msebor at gcc dot gnu.org 2021-09-17 11:41 ` hv at crypt dot org 2021-09-20 14:56 ` msebor at gcc dot gnu.org 2021-10-18 13:51 ` fw at gcc dot gnu.org 2021-10-18 21:10 ` [Bug tree-optimization/102329] [11/12 Regression] " pinskia at gcc dot gnu.org 2022-01-20 10:00 ` rguenth at gcc dot gnu.org 2022-04-21 7:50 ` rguenth at gcc dot gnu.org 2023-05-29 10:05 ` [Bug tree-optimization/102329] [11/12/13/14 " jakub 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-102329-4-zgG7Fqg2Tt@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).