public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/96571] Bad "set but not used" warning with _Generic Date: Wed, 16 Sep 2020 19:23:04 +0000 [thread overview] Message-ID: <bug-96571-4-Fu9jO3ND75@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-96571-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96571 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:d2472e513c6490b6e2832b07d08731df26e6dc06 commit r9-8909-gd2472e513c6490b6e2832b07d08731df26e6dc06 Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Aug 18 07:51:58 2020 +0200 c: Fix -Wunused-but-set-* warning with _Generic [PR96571] The following testcase shows various problems with -Wunused-but-set* warnings and _Generic construct. I think it is best to treat the selector and the ignored expressions as (potentially) read, because when they are parsed, the vars in there are already marked as TREE_USED. 2020-08-18 Jakub Jelinek <jakub@redhat.com> PR c/96571 * c-parser.c (c_parser_generic_selection): Change match_found from bool to int, holding index of the match. Call mark_exp_read on the selector expression and on expressions other than the selected one. * gcc.dg/Wunused-var-4.c: New test. (cherry picked from commit 6d42cbe5ad7a7b46437f2576c9920e44dc14b386)
next prev parent reply other threads:[~2020-09-16 19:23 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-11 16:33 [Bug c/96571] New: " jsm28 at gcc dot gnu.org 2020-08-12 9:12 ` [Bug c/96571] " jakub at gcc dot gnu.org 2020-08-13 16:40 ` jakub at gcc dot gnu.org 2020-08-18 5:52 ` cvs-commit at gcc dot gnu.org 2020-08-25 17:45 ` cvs-commit at gcc dot gnu.org 2020-09-16 19:23 ` cvs-commit at gcc dot gnu.org [this message] 2020-09-17 17:57 ` 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-96571-4-Fu9jO3ND75@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).