re PR c/57630 (Error should include -std=c11 and friends)
authorMarek Polacek <polacek@redhat.com>
Tue, 18 Jun 2013 07:41:19 +0000 (07:41 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 18 Jun 2013 07:41:19 +0000 (07:41 +0000)
PR c/57630
* c-decl.c (check_for_loop_decls): Improve diagnostics messages.

From-SVN: r200163

gcc/c/ChangeLog
gcc/c/c-decl.c

index 6179c3bb546536d1d17878044b6c186f43081712..05766caa8ff8d82b33b3990f0e349afdb3619209 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-18  Marek Polacek  <polacek@redhat.com>
+
+       PR c/57630
+       * c-decl.c (check_for_loop_decls): Improve diagnostics messages.
+
 2013-06-12  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
        * c-array-notation.c (build_array_notation_expr): Reject array notation
index d9bbf5c25f9c39a444459bfcf944351021717b18..8170a80ac6d08d1d44a9df343c6109365bb38206 100644 (file)
@@ -8503,11 +8503,12 @@ check_for_loop_decls (location_t loc, bool turn_off_iso_c99_error)
         the C99 for loop scope.  This doesn't make much sense, so don't
         allow it.  */
       error_at (loc, "%<for%> loop initial declarations "
-               "are only allowed in C99 mode");
+               "are only allowed in C99 or C11 mode");
       if (hint)
        {
          inform (loc,
-                 "use option -std=c99 or -std=gnu99 to compile your code");
+                 "use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 "
+                 "to compile your code");
          hint = false;
        }
       return NULL_TREE;