diff options
author | Marek Polacek <polacek@redhat.com> | 2015-10-02 12:56:17 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-10-02 12:56:17 +0000 |
commit | 3e3b8d63e54773e0f5add898ad55acf1be22d950 (patch) | |
tree | 2068f8ebdec3daf3c4cd446ea0c01a7dfe75c37d /gcc/Makefile.in | |
parent | 0f6ca79c15711e28ea7a6330fc9ac017077fbaad (diff) | |
download | gcc-3e3b8d63e54773e0f5add898ad55acf1be22d950.zip gcc-3e3b8d63e54773e0f5add898ad55acf1be22d950.tar.gz gcc-3e3b8d63e54773e0f5add898ad55acf1be22d950.tar.bz2 |
re PR c/64249 (Missing warning for if (A) else if (A))
PR c/64249
* c-common.c (warn_duplicated_cond_add_or_warn): New function.
* c-common.h (warn_duplicated_cond_add_or_warn): Declare.
* c.opt (Wduplicated-cond): New option.
* c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter
and pass it down to c_parser_if_statement.
(c_parser_else_body): Add CHAIN parameter and pass it down to
c_parser_statement_after_labels.
(c_parser_if_statement): Add CHAIN parameter. Add code to warn about
duplicated if-else-if conditions.
* parser.c (cp_parser_statement): Add CHAIN parameter and pass it
down to cp_parser_selection_statement.
(cp_parser_selection_statement): Add CHAIN parameter. Add code to
warn about duplicated if-else-if conditions.
(cp_parser_implicitly_scoped_statement): Add CHAIN parameter and pass
it down to cp_parser_statement.
* doc/invoke.texi: Document -Wduplicated-cond.
* Makefile.in (insn-latencytab.o): Use -Wno-duplicated-cond.
(insn-dfatab.o): Likewise.
* genemit.c (gen_exp): Rewrite condition to avoid -Wduplicated-cond
warning.
* c-c++-common/Wduplicated-cond-1.c: New test.
* c-c++-common/Wduplicated-cond-2.c: New test.
* c-c++-common/Wduplicated-cond-3.c: New test.
* c-c++-common/Wduplicated-cond-4.c: New test.
* c-c++-common/Wmisleading-indentation.c (fn_37): Avoid
-Wduplicated-cond warning.
From-SVN: r228388
Diffstat (limited to 'gcc/Makefile.in')
-rw-r--r-- | gcc/Makefile.in | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 009c745..b22b5ab 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -217,6 +217,8 @@ libgcov-merge-tool.o-warn = -Wno-error gimple-match.o-warn = -Wno-unused generic-match.o-warn = -Wno-unused dfp.o-warn = -Wno-strict-aliasing +insn-latencytab.o-warn = -Wno-duplicated-cond +insn-dfatab.o-warn = -Wno-duplicated-cond # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either |