diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-08-18 07:51:58 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-08-18 07:51:58 +0200 |
commit | 6d42cbe5ad7a7b46437f2576c9920e44dc14b386 (patch) | |
tree | a779ecc71eda6e6e0af4fdb3d12ff69855e93c5f /gcc/config/i386 | |
parent | 1bc4e811aa7249ec972ee7ea5b9bb23e8a0cd69e (diff) | |
download | gcc-6d42cbe5ad7a7b46437f2576c9920e44dc14b386.zip gcc-6d42cbe5ad7a7b46437f2576c9920e44dc14b386.tar.gz gcc-6d42cbe5ad7a7b46437f2576c9920e44dc14b386.tar.bz2 |
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.
Diffstat (limited to 'gcc/config/i386')
0 files changed, 0 insertions, 0 deletions