]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc:
authorJoseph Myers <joseph@codesourcery.com>
Tue, 20 Dec 2011 20:44:13 +0000 (20:44 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 20 Dec 2011 20:44:13 +0000 (20:44 +0000)
* c-decl.c (diagnose_mismatched_decls, grokdeclarator, grokfield)
(finish_struct): Refer to C11 in comments.  Use flag_isoc11.
* c-parser.c (c_parser_static_assert_declaration)
(c_parser_static_assert_declaration_no_semi, c_parser_declspecs)
(c_parser_alignas_specifier, c_parser_alignof_expression): Refer
to C11 in comments.  Use flag_isoc11.
* c-typeck.c (comptypes_check_different_types): Refer to C11 in
comment.
* doc/cpp.texi (Overview): Refer to -std=c11 instead of -std=c1x.
* doc/cppopts.texi (-std=c11, -std=gnu11): Document in preference
to -std=c1x and -std=gnu1x.
* doc/extend.texi (Inline, Alternate Keywords, Other Builtins)
(__builtin_complex, Unnamed Fields): Refer to -std=c11 and C11
instead of -std=c1x and C1X.
* doc/invoke.texi (-std=c11, -std=iso9899:2011): Document in
preference to -std=c1x.
(-std=gnu11): Document in preference to -std=gnu1x.
* doc/standards.texi: Document C11 instead of C1X.  Document C11
as actual standard.  Document headers required from freestanding
C11 implementations.
* ginclude/float.h, ginclude/stddef.h: Test __STDC_VERSION__ >=
201112L for C11.  Update comments to refer to C11.

gcc/c-family:
* c-common.c (flag_isoc99): Update comment to refer to C11.
(flag_isoc1x): Change to flag_isoc11.
* c-common.h (flag_isoc99): Update comment to refer to C11.
(flag_isoc1x): Change to flag_isoc11.
* c-cppbuiltin.c (cpp_atomic_builtins): Change comment to refer to
C11.
* c-opts.c (set_std_c1x): Change to set_std_c11.
(c_common_handle_option): Handle OPT_std_c11 and OPT_std_gnu11.
Call set_std_c11.
(set_std_c89, set_std_c99, set_std_c11): Use flag_isoc11.
(set_std_c1): Use CLK_STDC11 and CLK_GNUC11.
* c.opt (std=c1x): Change to std=c11.  Document as non-draft
standard.
(std=c1x, std=iso9899:2011): Add as aliases of std=c11.
(std=gnu1x): Change to std=gnu11.  Refer to non-draft standard.
(std=gnu1x): Make alias of std=gnu11.

gcc/testsuite:
* gcc.dg/c11-version-1.c, gcc.dg/c11-version-2.c,
gcc.dg/c94-version-1.c, gcc.dg/c99-version-1.c,
gcc.dg/gnu11-version-1.c: New tests.

libcpp:
* include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
(CLK_STDC1X): Change to CLK_STDC11.
* init.c (lang_defaults): Update comments.
(cpp_init_builtins): Update language tests.  Use 201112L for C11
__STDC_VERSION__.

From-SVN: r182551

26 files changed:
gcc/ChangeLog
gcc/c-decl.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-cppbuiltin.c
gcc/c-family/c-opts.c
gcc/c-family/c.opt
gcc/c-parser.c
gcc/c-typeck.c
gcc/doc/cpp.texi
gcc/doc/cppopts.texi
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/doc/standards.texi
gcc/ginclude/float.h
gcc/ginclude/stddef.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/c11-version-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c11-version-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c94-version-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c99-version-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/gnu11-version-1.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/include/cpplib.h
libcpp/init.c

index 5135a67c5411fea3e7ea4c9c6f1d4a5c5b0af3b4..ad53a035ba96fdb25f32d925d029556dc660a8ec 100644 (file)
@@ -1,3 +1,28 @@
+2011-12-20  Joseph Myers  <joseph@codesourcery.com>
+
+       * c-decl.c (diagnose_mismatched_decls, grokdeclarator, grokfield)
+       (finish_struct): Refer to C11 in comments.  Use flag_isoc11.
+       * c-parser.c (c_parser_static_assert_declaration)
+       (c_parser_static_assert_declaration_no_semi, c_parser_declspecs)
+       (c_parser_alignas_specifier, c_parser_alignof_expression): Refer
+       to C11 in comments.  Use flag_isoc11.
+       * c-typeck.c (comptypes_check_different_types): Refer to C11 in
+       comment.
+       * doc/cpp.texi (Overview): Refer to -std=c11 instead of -std=c1x.
+       * doc/cppopts.texi (-std=c11, -std=gnu11): Document in preference
+       to -std=c1x and -std=gnu1x.
+       * doc/extend.texi (Inline, Alternate Keywords, Other Builtins)
+       (__builtin_complex, Unnamed Fields): Refer to -std=c11 and C11
+       instead of -std=c1x and C1X.
+       * doc/invoke.texi (-std=c11, -std=iso9899:2011): Document in
+       preference to -std=c1x.
+       (-std=gnu11): Document in preference to -std=gnu1x.
+       * doc/standards.texi: Document C11 instead of C1X.  Document C11
+       as actual standard.  Document headers required from freestanding
+       C11 implementations.
+       * ginclude/float.h, ginclude/stddef.h: Test __STDC_VERSION__ >=
+       201112L for C11.  Update comments to refer to C11.
+
 2011-12-20  Andreas Schwab  <schwab@linux-m68k.org>
 
        * configure: Regenerate.
index 1cdbf2fe6a8afa702dcacb4c74db7d0fe3c37606..96e9c7d17534c33d452519a82a33281e90fa6a69 100644 (file)
@@ -1786,7 +1786,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
   /* Redeclaration of a type is a constraint violation (6.7.2.3p1),
      but silently ignore the redeclaration if either is in a system
      header.  (Conflicting redeclarations were handled above.)  This
-     is allowed for C1X if the types are the same, not just
+     is allowed for C11 if the types are the same, not just
      compatible.  */
   if (TREE_CODE (newdecl) == TYPE_DECL)
     {
@@ -1815,7 +1815,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
                 newdecl);
          locate_old_decl (olddecl);
        }
-      else if (pedantic && !flag_isoc1x)
+      else if (pedantic && !flag_isoc11)
        {
          pedwarn (input_location, OPT_pedantic,
                   "redefinition of typedef %q+D", newdecl);
@@ -6077,7 +6077,7 @@ grokdeclarator (const struct c_declarator *declarator,
              DECL_DECLARED_INLINE_P (decl) = 1;
            if (declspecs->noreturn_p)
              {
-               if (!flag_isoc1x)
+               if (!flag_isoc11)
                  {
                    if (flag_isoc99)
                      pedwarn (loc, OPT_pedantic,
@@ -6761,7 +6761,7 @@ grokfield (location_t loc,
 
         If this is something of the form "foo;" and foo is a TYPE_DECL, then
           If foo names a structure or union without a tag, then this
-            is an anonymous struct (this is permitted by C1X).
+            is an anonymous struct (this is permitted by C11).
           If MS or Plan 9 extensions are enabled and foo names a
             structure, then again this is an anonymous struct.
           Otherwise this is an error.
@@ -6792,7 +6792,7 @@ grokfield (location_t loc,
          pedwarn (loc, 0, "declaration does not declare anything");
          return NULL_TREE;
        }
-      if (!flag_isoc1x)
+      if (!flag_isoc11)
        {
          if (flag_isoc99)
            pedwarn (loc, OPT_pedantic,
@@ -7072,7 +7072,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
        {
          if (DECL_NAME (x) != 0)
            break;
-         if (flag_isoc1x
+         if (flag_isoc11
              && (TREE_CODE (TREE_TYPE (x)) == RECORD_TYPE
                  || TREE_CODE (TREE_TYPE (x)) == UNION_TYPE))
            break;
index 2b8f32578619d82720c526cfabdda4b8e43171ce..b076e7602f3764ae24b7880434a89e2ab17a51ce 100644 (file)
@@ -1,3 +1,22 @@
+2011-12-20  Joseph Myers  <joseph@codesourcery.com>
+
+       * c-common.c (flag_isoc99): Update comment to refer to C11.
+       (flag_isoc1x): Change to flag_isoc11.
+       * c-common.h (flag_isoc99): Update comment to refer to C11.
+       (flag_isoc1x): Change to flag_isoc11.
+       * c-cppbuiltin.c (cpp_atomic_builtins): Change comment to refer to
+       C11.
+       * c-opts.c (set_std_c1x): Change to set_std_c11.
+       (c_common_handle_option): Handle OPT_std_c11 and OPT_std_gnu11.
+       Call set_std_c11.
+       (set_std_c89, set_std_c99, set_std_c11): Use flag_isoc11.
+       (set_std_c1): Use CLK_STDC11 and CLK_GNUC11.
+       * c.opt (std=c1x): Change to std=c11.  Document as non-draft
+       standard.
+       (std=c1x, std=iso9899:2011): Add as aliases of std=c11.
+       (std=gnu1x): Change to std=gnu11.  Refer to non-draft standard.
+       (std=gnu1x): Make alias of std=gnu11.
+
 2011-12-19  Jason Merrill  <jason@redhat.com>
 
        PR c++/51228
index 0562f2624f3c8ffbead2b44b7161949d917a57d3..6f88760c9476bc7ed55b8eb271b16c3312bf5d44 100644 (file)
@@ -216,13 +216,13 @@ int flag_cond_mismatch;
 
 int flag_isoc94;
 
-/* Nonzero means use the ISO C99 (or C1X) dialect of C.  */
+/* Nonzero means use the ISO C99 (or C11) dialect of C.  */
 
 int flag_isoc99;
 
-/* Nonzero means use the ISO C1X dialect of C.  */
+/* Nonzero means use the ISO C11 dialect of C.  */
 
-int flag_isoc1x;
+int flag_isoc11;
 
 /* Nonzero means that we have builtin functions, and main is an int.  */
 
index 103c5816ac4489b76dc939fd873fe3dab50462fa..835b13bbce8bb1798df73de89ba4f861fd31cbae 100644 (file)
@@ -106,7 +106,7 @@ enum rid
   RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128,
   RID_FRACT, RID_ACCUM,
 
-  /* C1X */
+  /* C11 */
   RID_ALIGNAS,
 
   /* This means to warn that this is a C++ keyword, and then treat it
@@ -607,13 +607,13 @@ extern int flag_cond_mismatch;
 
 extern int flag_isoc94;
 
-/* Nonzero means use the ISO C99 (or C1X) dialect of C.  */
+/* Nonzero means use the ISO C99 (or C11) dialect of C.  */
 
 extern int flag_isoc99;
 
-/* Nonzero means use the ISO C1X dialect of C.  */
+/* Nonzero means use the ISO C11 dialect of C.  */
 
-extern int flag_isoc1x;
+extern int flag_isoc11;
 
 /* Nonzero means that we have builtin functions, and main is an int.  */
 
index 8d0d4af9c925d02b5bf62dedd355a8a7c6e56d58..7e7b9c158767813309bd3051d4a2b147f7522650 100644 (file)
@@ -646,7 +646,7 @@ cpp_atomic_builtins (cpp_reader *pfile)
       have_swap[16] = true;
     }
 
-  /* Tell the source code about various types.  These map to the C++11 and C1x
+  /* Tell the source code about various types.  These map to the C++11 and C11
      macros where 2 indicates lock-free always, and 1 indicates sometimes
      lock free.  */
 #define SIZEOF_NODE(T) (tree_low_cst (TYPE_SIZE_UNIT (T), 1))
index a08b0e80a568045703f3194366e91a82157c4ca9..3a4d8a87f62d17313cf1da8bb65c5f48586e3a36 100644 (file)
@@ -113,7 +113,7 @@ static void set_std_cxx98 (int);
 static void set_std_cxx11 (int);
 static void set_std_c89 (int, int);
 static void set_std_c99 (int);
-static void set_std_c1x (int);
+static void set_std_c11 (int);
 static void check_deps_environment_vars (void);
 static void handle_deferred_opts (void);
 static void sanitize_cpp_opts (void);
@@ -799,14 +799,14 @@ c_common_handle_option (size_t scode, const char *arg, int value,
        set_std_c99 (false /* ISO */);
       break;
 
-    case OPT_std_c1x:
+    case OPT_std_c11:
       if (!preprocessing_asm_p)
-       set_std_c1x (true /* ISO */);
+       set_std_c11 (true /* ISO */);
       break;
 
-    case OPT_std_gnu1x:
+    case OPT_std_gnu11:
       if (!preprocessing_asm_p)
-       set_std_c1x (false /* ISO */);
+       set_std_c11 (false /* ISO */);
       break;
 
     case OPT_trigraphs:
@@ -1465,7 +1465,7 @@ set_std_c89 (int c94, int iso)
   flag_no_nonansi_builtin = iso;
   flag_isoc94 = c94;
   flag_isoc99 = 0;
-  flag_isoc1x = 0;
+  flag_isoc11 = 0;
 }
 
 /* Set the C 99 standard (without GNU extensions if ISO).  */
@@ -1476,20 +1476,20 @@ set_std_c99 (int iso)
   flag_no_asm = iso;
   flag_no_nonansi_builtin = iso;
   flag_iso = iso;
-  flag_isoc1x = 0;
+  flag_isoc11 = 0;
   flag_isoc99 = 1;
   flag_isoc94 = 1;
 }
 
-/* Set the C 1X standard draft (without GNU extensions if ISO).  */
+/* Set the C 11 standard (without GNU extensions if ISO).  */
 static void
-set_std_c1x (int iso)
+set_std_c11 (int iso)
 {
-  cpp_set_lang (parse_in, iso ? CLK_STDC1X: CLK_GNUC1X);
+  cpp_set_lang (parse_in, iso ? CLK_STDC11: CLK_GNUC11);
   flag_no_asm = iso;
   flag_no_nonansi_builtin = iso;
   flag_iso = iso;
-  flag_isoc1x = 1;
+  flag_isoc11 = 1;
   flag_isoc99 = 1;
   flag_isoc94 = 1;
 }
index 7694794e0c66e5d0f59fa1162dd77542d5dfb8fb..42c9a0dfc665cf915c4753fbd71f15f820e42414 100644 (file)
@@ -1191,9 +1191,13 @@ std=c++0x
 C++ ObjC++ Alias(std=c++11)
 Deprecated in favor of -std=c++11
 
-std=c1x
+std=c11
 C ObjC
-Conform to the ISO 201X C standard draft (experimental and incomplete support)
+Conform to the ISO 2011 C standard (experimental and incomplete support)
+
+std=c1x
+C ObjC Alias(std=c11)
+Deprecated in favor of -std=c11
 
 std=c89
 C ObjC Alias(std=c90)
@@ -1229,9 +1233,13 @@ std=gnu++0x
 C++ ObjC++ Alias(std=gnu++11)
 Deprecated in favor of -std=gnu++11
 
-std=gnu1x
+std=gnu11
 C ObjC
-Conform to the ISO 201X C standard draft with GNU extensions (experimental and incomplete support)
+Conform to the ISO 2011 C standard with GNU extensions (experimental and incomplete support)
+
+std=gnu1x
+C ObjC Alias(std=gnu11)
+Deprecated in favor of -std=gnu11
 
 std=gnu89
 C ObjC Alias(std=gnu90)
@@ -1265,6 +1273,10 @@ std=iso9899:199x
 C ObjC Alias(std=c99)
 Deprecated in favor of -std=iso9899:1999
 
+std=iso9899:2011
+C ObjC Alias(std=c11)
+Conform to the ISO 2011 C standard (experimental and incomplete support)
+
 traditional
 Driver
 
index 0a268a691f5f7f28a33b8decca8f26dbffbd27c2..867ab4183ad3bac5ee223ffff46f4a94b8f4ca18 100644 (file)
@@ -1796,7 +1796,7 @@ c_parser_asm_definition (c_parser *parser)
   c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
 }
 
-/* Parse a static assertion (C1X N1425 6.7.10).
+/* Parse a static assertion (C11 6.7.10).
 
    static_assert-declaration:
      static_assert-declaration-no-semi ;
@@ -1811,7 +1811,7 @@ c_parser_static_assert_declaration (c_parser *parser)
     c_parser_skip_to_end_of_block_or_statement (parser);
 }
 
-/* Parse a static assertion (C1X N1425 6.7.10), without the trailing
+/* Parse a static assertion (C11 6.7.10), without the trailing
    semicolon.
 
    static_assert-declaration-no-semi:
@@ -1827,7 +1827,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
 
   gcc_assert (c_parser_next_token_is_keyword (parser, RID_STATIC_ASSERT));
   assert_loc = c_parser_peek_token (parser)->location;
-  if (!flag_isoc1x)
+  if (!flag_isoc11)
     {
       if (flag_isoc99)
        pedwarn (assert_loc, OPT_pedantic,
@@ -1902,7 +1902,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
 
    Function specifiers (inline) are from C99, and are currently
    handled as storage class specifiers, as is __thread.  Alignment
-   specifiers are from C1X.
+   specifiers are from C11.
 
    C90 6.5.1, C99 6.7.1:
    storage-class-specifier:
@@ -1917,7 +1917,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
      inline
      _Noreturn
 
-   (_Noreturn is new in C1X.)
+   (_Noreturn is new in C11.)
 
    C90 6.5.2, C99 6.7.2:
    type-specifier:
@@ -2768,7 +2768,7 @@ c_parser_typeof_specifier (c_parser *parser)
 
 /* Parse an alignment-specifier.
 
-   C1X 6.7.5:
+   C11 6.7.5:
 
    alignment-specifier:
      _Alignas ( type-name )
@@ -2782,7 +2782,7 @@ c_parser_alignas_specifier (c_parser * parser)
   location_t loc = c_parser_peek_token (parser)->location;
   gcc_assert (c_parser_next_token_is_keyword (parser, RID_ALIGNAS));
   c_parser_consume_token (parser);
-  if (!flag_isoc1x)
+  if (!flag_isoc11)
     {
       if (flag_isoc99)
        pedwarn (loc, OPT_pedantic,
@@ -5841,7 +5841,7 @@ c_parser_cast_expression (c_parser *parser, struct c_expr *after)
      __alignof__ ( type-name )
      && identifier
 
-   (C1X permits _Alignof with type names only.)
+   (C11 permits _Alignof with type names only.)
 
    unary-operator: one of
      __extension__ __real__ __imag__
@@ -6038,9 +6038,9 @@ c_parser_alignof_expression (c_parser *parser)
   tree alignof_spelling = c_parser_peek_token (parser)->value;
   gcc_assert (c_parser_next_token_is_keyword (parser, RID_ALIGNOF));
   /* A diagnostic is not required for the use of this identifier in
-     the implementation namespace; only diagnose it for the C1X
+     the implementation namespace; only diagnose it for the C11
      spelling because of existing code using the other spellings.  */
-  if (!flag_isoc1x
+  if (!flag_isoc11
       && strcmp (IDENTIFIER_POINTER (alignof_spelling), "_Alignof") == 0)
     {
       if (flag_isoc99)
index 4a134b0e52412ed206170d6288482ee3fe40a209..b696e5e38beb933c0ca32c26c0a80d38c3edb092 100644 (file)
@@ -1014,7 +1014,7 @@ comptypes_check_different_types (tree type1, tree type2,
    compatible integer type, then this sets *ENUM_AND_INT_P to true;
    *ENUM_AND_INT_P is never set to false.  If DIFFERENT_TYPES_P is not
    NULL, and the types are compatible but different enough not to be
-   permitted in C1X typedef redeclarations, then this sets
+   permitted in C11 typedef redeclarations, then this sets
    *DIFFERENT_TYPES_P to true; *DIFFERENT_TYPES_P is never set to
    false, but may or may not be set if the types are incompatible.
    This differs from comptypes, in that we don't free the seen
index 821d81687effd1d3213c6c2b89ec421416005681..230d32bdfc0ba156497b616e9b35922e858dc681 100644 (file)
@@ -216,7 +216,7 @@ few things required by the standard.  These are features which are
 rarely, if ever, used, and may cause surprising changes to the meaning
 of a program which does not expect them.  To get strict ISO Standard C,
 you should use the @option{-std=c90}, @option{-std=c99} or
-@option{-std=c1x} options, depending
+@option{-std=c11} options, depending
 on which version of the standard you want.  To get all the mandatory
 diagnostics, you must also use @option{-pedantic}.  @xref{Invocation}.
 
index 6c70a0a9cd00bdd3762ebc72240b09fbb15e9b32..205d87088335ed524eeb90c28a5d0fd0143874ca 100644 (file)
@@ -392,8 +392,11 @@ The 1990 C standard, as amended in 1994.
 The revised ISO C standard, published in December 1999.  Before
 publication, this was known as C9X@.
 
-@item c1x
-The next version of the ISO C standard, still under development.
+@item iso9899:2011
+@itemx c11
+@itemx c1x
+The revised ISO C standard, published in December 2011.  Before
+publication, this was known as C1X@.
 
 @item gnu90
 @itemx gnu89
@@ -403,9 +406,9 @@ The 1990 C standard plus GNU extensions.  This is the default.
 @itemx gnu9x
 The 1999 C standard plus GNU extensions.
 
-@item gnu1x
-The next version of the ISO C standard, still under development, plus
-GNU extensions.
+@item gnu11
+@itemx gnu1x
+The 2011 C standard plus GNU extensions.
 
 @item c++98
 The 1998 ISO C++ standard plus amendments.
index 7f39a61fdb28bde133b606d1e7ecedbfd424015b..6c904c10030911ec75d80d004817c5e3a395063b 100644 (file)
@@ -5298,8 +5298,8 @@ GCC implements three different semantics of declaring a function
 inline.  One is available with @option{-std=gnu89} or
 @option{-fgnu89-inline} or when @code{gnu_inline} attribute is present
 on all inline declarations, another when
-@option{-std=c99}, @option{-std=c1x},
-@option{-std=gnu99} or @option{-std=gnu1x}
+@option{-std=c99}, @option{-std=c11},
+@option{-std=gnu99} or @option{-std=gnu11}
 (without @option{-fgnu89-inline}), and the third
 is used when compiling C++.
 
@@ -6313,7 +6313,7 @@ a general-purpose header file that should be usable by all programs,
 including ISO C programs.  The keywords @code{asm}, @code{typeof} and
 @code{inline} are not available in programs compiled with
 @option{-ansi} or @option{-std} (although @code{inline} can be used in a
-program compiled with @option{-std=c99} or @option{-std=c1x}).  The
+program compiled with @option{-std=c99} or @option{-std=c11}).  The
 ISO C99 keyword
 @code{restrict} is only available when @option{-std=gnu99} (which will
 eventually be the default) or @option{-std=c99} (or the equivalent
@@ -7623,7 +7623,7 @@ be emitted.
 @opindex ansi
 @opindex std
 Outside strict ISO C mode (@option{-ansi}, @option{-std=c90},
-@option{-std=c99} or @option{-std=c1x}), the functions
+@option{-std=c99} or @option{-std=c11}), the functions
 @code{_exit}, @code{alloca}, @code{bcmp}, @code{bzero},
 @code{dcgettext}, @code{dgettext}, @code{dremf}, @code{dreml},
 @code{drem}, @code{exp10f}, @code{exp10l}, @code{exp10}, @code{ffsll},
@@ -7843,7 +7843,7 @@ future revisions.
 @deftypefn {Built-in Function} @var{type} __builtin_complex (@var{real}, @var{imag})
 
 The built-in function @code{__builtin_complex} is provided for use in
-implementing the ISO C1X macros @code{CMPLXF}, @code{CMPLX} and
+implementing the ISO C11 macros @code{CMPLXF}, @code{CMPLX} and
 @code{CMPLXL}.  @var{real} and @var{imag} must have the same type, a
 real binary floating-point type, and the result has the corresponding
 complex type with real and imaginary parts @var{real} and @var{imag}.
@@ -14123,7 +14123,7 @@ versions earlier than 4.4.
 @cindex @code{struct}
 @cindex @code{union}
 
-As permitted by ISO C1X and for compatibility with other compilers,
+As permitted by ISO C11 and for compatibility with other compilers,
 GCC allows you to define
 a structure or union that contains, as fields, structures and unions
 without names.  For example:
index d0d324341377805d1551268c86d0c9c3ba1adbb4..36c37e081ee5c067a63d283c35ef000737ef90f9 100644 (file)
@@ -1557,11 +1557,12 @@ ISO C99.  Note that this standard is not yet fully supported; see
 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
 
-@item c1x
-ISO C1X, the draft of the next revision of the ISO C standard.
-Support is limited and experimental and features enabled by this
-option may be changed or removed if changed in or removed from the
-standard draft.
+@item c11
+@itemx c1x
+@itemx iso9899:2011
+ISO C11, the 2011 revision of the ISO C standard.
+Support is incomplete and experimental.  The name @samp{c1x} is
+deprecated.
 
 @item gnu90
 @itemx gnu89
@@ -1573,10 +1574,10 @@ is the default for C code.
 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
 this will become the default.  The name @samp{gnu9x} is deprecated.
 
+@item gnu11
 @item gnu1x
-GNU dialect of ISO C1X.  Support is limited and experimental and
-features enabled by this option may be changed or removed if changed
-in or removed from the standard draft.
+GNU dialect of ISO C11.  Support is incomplete and experimental.  The
+name @samp{gnu1x} is deprecated.
 
 @item c++98
 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
index 90ddd4769d69fc9c9daf8a303417fde5ef420275..4e288c64c2fce056ff030b0979214d67af16748b 100644 (file)
@@ -33,6 +33,8 @@ with some exceptions, and possibly with some extensions.
 @cindex C99
 @cindex ISO C9X
 @cindex C9X
+@cindex ISO C11
+@cindex C11
 @cindex ISO C1X
 @cindex C1X
 @cindex Technical Corrigenda
@@ -95,9 +97,11 @@ Errors in the 1999 ISO C standard were corrected in three Technical
 Corrigenda published in 2001, 2004 and 2007.  GCC does not support the
 uncorrected version.
 
-A fourth version of the C standard, known as @dfn{C1X}, is under
-development; GCC has limited preliminary support for parts of this
-standard, enabled with @option{-std=c1x}.
+A fourth version of the C standard, known as @dfn{C11}, was published
+in 2011 as ISO/IEC 9899:2011.  GCC has limited incomplete support for
+parts of this standard, enabled with @option{-std=c11} or
+@option{-std=iso9899:2011}.  (While in development, drafts of this
+standard version were referred to as @dfn{C1X}.)
 
 By default, GCC provides some extensions to the C language that on
 rare occasions conflict with the C standard.  @xref{C
@@ -106,12 +110,14 @@ Extensions,,Extensions to the C Language Family}.  Use of the
 they conflict with the C standard version selected.  You may also
 select an extended version of the C language explicitly with
 @option{-std=gnu90} (for C90 with GNU extensions), @option{-std=gnu99}
-(for C99 with GNU extensions) or @option{-std=gnu1x} (for C1X with GNU
+(for C99 with GNU extensions) or @option{-std=gnu11} (for C11 with GNU
 extensions).  The default, if no C language dialect
 options are given, is @option{-std=gnu90}; this will change to
-@option{-std=gnu99} in some future release when the C99 support is
+@option{-std=gnu99} or @option{-std=gnu11} in some future release when
+the C99 or C11 support is
 complete.  Some features that are part of the C99 standard are
-accepted as extensions in C90 mode.
+accepted as extensions in C90 mode, and some features that are part of
+the C11 standard are accepted as extensions in C90 and C99 modes.
 
 The ISO C standard defines (in clause 4) two classes of conforming
 implementation.  A @dfn{conforming hosted implementation} supports the
@@ -119,8 +125,9 @@ whole standard including all the library facilities; a @dfn{conforming
 freestanding implementation} is only required to provide certain
 library facilities: those in @code{<float.h>}, @code{<limits.h>},
 @code{<stdarg.h>}, and @code{<stddef.h>}; since AMD1, also those in
-@code{<iso646.h>}; and in C99, also those in @code{<stdbool.h>} and
-@code{<stdint.h>}.  In addition, complex types, added in C99, are not
+@code{<iso646.h>}; since C99, also those in @code{<stdbool.h>} and
+@code{<stdint.h>}; and since C11, also those in @code{<stdalign.h>}
+and @code{<stdnoreturn.h>}.  In addition, complex types, added in C99, are not
 required for freestanding implementations.  The standard also defines
 two environments for programs, a @dfn{freestanding environment},
 required of all implementations and which may not have library
index b78cc0ca6afe90c00af570bb8636d365e7d2cf60..2954cc4896afb87b1f61c87a0e5e164c98983606 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -157,7 +158,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #endif /* C99 */
 
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ > 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
 /* Versions of DECIMAL_DIG for each floating-point type.  */
 #undef FLT_DECIMAL_DIG
 #undef DBL_DECIMAL_DIG
@@ -194,7 +195,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define LDBL_TRUE_MIN  __LDBL_MIN__
 #endif
 
-#endif /* C1X */
+#endif /* C11 */
 
 #ifdef __STDC_WANT_DEC_FP__
 /* Draft Technical Report 24732, extension for decimal floating-point
index 1cc3cb4e75a08493ffd5328eac735da10f78f277..a78a77033871deb3d9f9835086d5874bd1a1f02d 100644 (file)
@@ -412,7 +412,7 @@ typedef __WINT_TYPE__ wint_t;
 /* Offset of member MEMBER in a struct of type TYPE. */
 #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
 
-#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 199901L) \
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
   || (defined(__cplusplus) && __cplusplus >= 201103L)
 #ifndef _GCC_MAX_ALIGN_T
 #define _GCC_MAX_ALIGN_T
@@ -424,7 +424,7 @@ typedef struct {
   long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
 } max_align_t;
 #endif
-#endif /* C1X or C++11.  */
+#endif /* C11 or C++11.  */
 
 #endif /* _STDDEF_H was defined this time */
 
index 8cb5093cb64faffb750fee53c9832aa742e95fff..1d329e24df03b430dcb75ea0a93b5c851f900753 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-20  Joseph Myers  <joseph@codesourcery.com>
+
+       * gcc.dg/c11-version-1.c, gcc.dg/c11-version-2.c,
+       gcc.dg/c94-version-1.c, gcc.dg/c99-version-1.c,
+       gcc.dg/gnu11-version-1.c: New tests.
+
 2011-12-20  Bernd Schmidt  <bernds@codesourcery.com>
 
        PR middle-end/51200
diff --git a/gcc/testsuite/gcc.dg/c11-version-1.c b/gcc/testsuite/gcc.dg/c11-version-1.c
new file mode 100644 (file)
index 0000000..9ab7936
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C11.  Test -std=c11.  */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 201112L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc/testsuite/gcc.dg/c11-version-2.c b/gcc/testsuite/gcc.dg/c11-version-2.c
new file mode 100644 (file)
index 0000000..3ac2305
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C11.  Test -std=iso9899:2011.  */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:2011 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 201112L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc/testsuite/gcc.dg/c94-version-1.c b/gcc/testsuite/gcc.dg/c94-version-1.c
new file mode 100644 (file)
index 0000000..7437dda
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C94.  */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:199409 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 199409L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc/testsuite/gcc.dg/c99-version-1.c b/gcc/testsuite/gcc.dg/c99-version-1.c
new file mode 100644 (file)
index 0000000..b99d54c
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C99.  */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 199901L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc/testsuite/gcc.dg/gnu11-version-1.c b/gcc/testsuite/gcc.dg/gnu11-version-1.c
new file mode 100644 (file)
index 0000000..56efbd4
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C11 with GNU extensions.  Test -std=gnu11.  */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu11 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 201112L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
index a24f6add72cb5c16b6f957c40dd4551e24f04ff7..261b8a52067df6fb076d03bf09a05b64f519417b 100644 (file)
@@ -1,3 +1,11 @@
+2011-12-20  Joseph Myers  <joseph@codesourcery.com>
+
+       * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
+       (CLK_STDC1X): Change to CLK_STDC11.
+       * init.c (lang_defaults): Update comments.
+       (cpp_init_builtins): Update language tests.  Use 201112L for C11
+       __STDC_VERSION__.
+
 2011-12-20  Andreas Schwab  <schwab@linux-m68k.org>
 
        * configure: Regenerate.
index 518fe945ebb71e67349ad87185b69e61e1aed811..bf59d016231dc8f817c2516e85bdff263277f020 100644 (file)
@@ -165,8 +165,8 @@ enum cpp_ttype
 #undef TK
 
 /* C language kind, used when calling cpp_create_reader.  */
-enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC1X,
-            CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC1X,
+enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC11,
+            CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC11,
             CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX11, CLK_CXX11, CLK_ASM};
 
 /* Payload of a NUMBER, STRING, CHAR or COMMENT token.  */
index ff006b11502254c98dea414ef74c3b9c2aaec6b6..5fa82ca9c3ec14d5eafd00bc6912537246a78e73 100644 (file)
@@ -87,11 +87,11 @@ static const struct lang_flags lang_defaults[] =
 { /*              c99 c++ xnum xid std  //   digr ulit rlit user_literals */
   /* GNUC89   */  { 0,  0,  1,   0,  0,   1,   1,   0,   0,    0 },
   /* GNUC99   */  { 1,  0,  1,   0,  0,   1,   1,   1,   1,    0 },
-  /* GNUC1X   */  { 1,  0,  1,   0,  0,   1,   1,   1,   1,    0 },
+  /* GNUC11   */  { 1,  0,  1,   0,  0,   1,   1,   1,   1,    0 },
   /* STDC89   */  { 0,  0,  0,   0,  1,   0,   0,   0,   0,    0 },
   /* STDC94   */  { 0,  0,  0,   0,  1,   0,   1,   0,   0,    0 },
   /* STDC99   */  { 1,  0,  1,   0,  1,   1,   1,   0,   0,    0 },
-  /* STDC1X   */  { 1,  0,  1,   0,  1,   1,   1,   1,   0,    0 },
+  /* STDC11   */  { 1,  0,  1,   0,  1,   1,   1,   1,   0,    0 },
   /* GNUCXX   */  { 0,  1,  1,   0,  0,   1,   1,   0,   0,    0 },
   /* CXX98    */  { 0,  1,  1,   0,  1,   1,   1,   0,   0,    0 },
   /* GNUCXX11 */  { 1,  1,  1,   0,  0,   1,   1,   1,   1,    1 },
@@ -474,9 +474,9 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
     _cpp_define_builtin (pfile, "__ASSEMBLER__ 1");
   else if (CPP_OPTION (pfile, lang) == CLK_STDC94)
     _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L");
-  else if (CPP_OPTION (pfile, lang) == CLK_STDC1X
-          || CPP_OPTION (pfile, lang) == CLK_GNUC1X)
-    _cpp_define_builtin (pfile, "__STDC_VERSION__ 201000L");
+  else if (CPP_OPTION (pfile, lang) == CLK_STDC11
+          || CPP_OPTION (pfile, lang) == CLK_GNUC11)
+    _cpp_define_builtin (pfile, "__STDC_VERSION__ 201112L");
   else if (CPP_OPTION (pfile, c99))
     _cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L");