re PR c/85318 (-Wc90-c99-compat does not warn about for loop initial declarations)
authorMarek Polacek <polacek@redhat.com>
Thu, 7 Jun 2018 19:15:45 +0000 (19:15 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 7 Jun 2018 19:15:45 +0000 (19:15 +0000)
commite4d44a372485acd8c0aca706221f1bfb880ce6f3
treee03aea2a8b2f06496434aa1035a5b292b877c99a
parenta3e87f07f3dc36bd42ed82853429d64a4b5b9703
re PR c/85318 (-Wc90-c99-compat does not warn about for loop initial declarations)

PR c/85318
* c-decl.c (check_for_loop_decls): Add -Wc90-c99-compat warning about
for loop initial declarations.

* gcc.dg/Wc90-c99-compat-10.c: New test.
* gcc.dg/Wc90-c99-compat-11.c: New test.
* gcc.dg/Wc90-c99-compat-12.c: New test.
* gcc.dg/Wc90-c99-compat-9.c: New test.

From-SVN: r261293
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wc90-c99-compat-10.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wc90-c99-compat-11.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wc90-c99-compat-12.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wc90-c99-compat-9.c [new file with mode: 0644]