public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6788] warn-access: Fix up warning_at arguments Date: Fri, 21 Jan 2022 10:23:05 +0000 (GMT) [thread overview] Message-ID: <20220121102305.3E1003858C60@sourceware.org> (raw) https://gcc.gnu.org/g:3e0b19f1d670aa37ac06d63d059c7277ae1188d8 commit r12-6788-g3e0b19f1d670aa37ac06d63d059c7277ae1188d8 Author: Jakub Jelinek <jakub@redhat.com> Date: Fri Jan 21 11:18:45 2022 +0100 warn-access: Fix up warning_at arguments A warning regression fix I'm about to post warns (and breaks bootstrap due to that) on the following spot. Seems it is a copy and paste from earlier code that mentions the %qD variable instead of talking about unnamed temporary. 2022-01-21 Jakub Jelinek <jakub@redhat.com> * gimple-ssa-warn-access.cc (pass_waccess::warn_invalid_pointer): Avoid passing var to warning_at when the format string doesn't refer to it. Diff: --- gcc/gimple-ssa-warn-access.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc index c36cd5d45d4..8bc33eeb6fa 100644 --- a/gcc/gimple-ssa-warn-access.cc +++ b/gcc/gimple-ssa-warn-access.cc @@ -3953,15 +3953,14 @@ pass_waccess::warn_invalid_pointer (tree ref, gimple *use_stmt, "may be used") : G_("using dangling pointer %qE to an unnamed " "temporary")), - ref, var)) + ref)) || (!ref && warning_at (use_loc, OPT_Wdangling_pointer_, (maybe ? G_("dangling pointer to an unnamed temporary " "may be used") : G_("using a dangling pointer to an unnamed " - "temporary")), - var))) + "temporary"))))) { inform (DECL_SOURCE_LOCATION (var), "unnamed temporary defined here");
reply other threads:[~2022-01-21 10:23 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220121102305.3E1003858C60@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@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).