mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-08 17:22:05 +03:00
doc: C11 and C++11 are now official
This commit is contained in:
@@ -2329,14 +2329,14 @@ func_all_modules ()
|
|||||||
func_module mbfile
|
func_module mbfile
|
||||||
func_end_table
|
func_end_table
|
||||||
|
|
||||||
element="Support for systems lacking draft ISO C 1X"
|
element="Support for systems lacking ISO C11"
|
||||||
func_section_wrap c1x_sup
|
func_section_wrap c11_sup
|
||||||
func_wrap H2
|
func_wrap H2
|
||||||
func_echo "$element"
|
func_echo "$element"
|
||||||
|
|
||||||
element="Core language properties"
|
element="Core language properties"
|
||||||
element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
|
element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
|
||||||
func_section_wrap c1x_core_properties
|
func_section_wrap c11_core_properties
|
||||||
func_wrap H3
|
func_wrap H3
|
||||||
func_echo "$element"
|
func_echo "$element"
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ See also the Gnulib module @code{assert}.
|
|||||||
Portability problems fixed by Gnulib:
|
Portability problems fixed by Gnulib:
|
||||||
@itemize
|
@itemize
|
||||||
@item
|
@item
|
||||||
The draft C1X and C++0X @code{static_assert}, and the draft C1X
|
The C11 and C++11 @code{static_assert}, and the C11
|
||||||
@code{_Static_assert}, are not supported by many platforms.
|
@code{_Static_assert}, are not supported by many platforms.
|
||||||
For example, GCC versions before 4.6.0 do not support @code{_Static_assert},
|
For example, GCC versions before 4.6.0 do not support @code{_Static_assert},
|
||||||
and G++ versions through at least 4.6.0 do not support @code{static_assert}.
|
and G++ versions through at least 4.6.0 do not support @code{static_assert}.
|
||||||
@@ -19,11 +19,11 @@ and G++ versions through at least 4.6.0 do not support @code{static_assert}.
|
|||||||
Portability problems not fixed by Gnulib:
|
Portability problems not fixed by Gnulib:
|
||||||
@itemize
|
@itemize
|
||||||
@item
|
@item
|
||||||
Draft C1X @code{_Static_assert} and draft C++0X @code{static_assert}
|
C11 @code{_Static_assert} and C++11 @code{static_assert}
|
||||||
are keywords that can be used without including @code{<assert.h>}.
|
are keywords that can be used without including @code{<assert.h>}.
|
||||||
The Gnulib substitutes are macros that require including @code{<assert.h>}.
|
The Gnulib substitutes are macros that require including @code{<assert.h>}.
|
||||||
@item
|
@item
|
||||||
The draft C1X @code{static_assert} and @code{_Static_assert} can also
|
The C11 @code{static_assert} and @code{_Static_assert} can also
|
||||||
be used within a @code{struct} or @code{union} specifier, in place of
|
be used within a @code{struct} or @code{union} specifier, in place of
|
||||||
an ordinary declaration of a member of the struct or union. The
|
an ordinary declaration of a member of the struct or union. The
|
||||||
Gnulib substitute can be used only as an ordinary declaration.
|
Gnulib substitute can be used only as an ordinary declaration.
|
||||||
|
@@ -2,9 +2,11 @@
|
|||||||
@section @file{stdalign.h}
|
@section @file{stdalign.h}
|
||||||
|
|
||||||
POSIX specification:@* Not in POSIX yet, but we expect it will be.
|
POSIX specification:@* Not in POSIX yet, but we expect it will be.
|
||||||
ISO C1X @url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf}
|
ISO C11 (latest free draft
|
||||||
|
@url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf})
|
||||||
sections 6.5.3.4, 6.7.5, 7.15.
|
sections 6.5.3.4, 6.7.5, 7.15.
|
||||||
C++0X @url{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf}
|
C++11 (latest free draft
|
||||||
|
@url{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf})
|
||||||
section 18.10.
|
section 18.10.
|
||||||
|
|
||||||
Gnulib module: stdalign
|
Gnulib module: stdalign
|
||||||
|
@@ -50,11 +50,11 @@ integer constant expression, then a compiler might reject a usage like
|
|||||||
@samp{verify (@var{V});} even when @var{V} is
|
@samp{verify (@var{V});} even when @var{V} is
|
||||||
nonzero.
|
nonzero.
|
||||||
|
|
||||||
Although the standard @code{assert} macro is a runtime test, draft C1X
|
Although the standard @code{assert} macro is a runtime test, C11
|
||||||
specifies a builtin @code{_Static_assert (@var{V},
|
specifies a builtin @code{_Static_assert (@var{V},
|
||||||
@var{STRING-LITERAL})}, its @file{assert.h} header has a similar macro
|
@var{STRING-LITERAL})}, its @file{assert.h} header has a similar macro
|
||||||
named @code{static_assert}, and draft C++0X has a similar
|
named @code{static_assert}, and C++11 has a similar
|
||||||
@code{static_assert} builtin. These draft builtins and macros differ
|
@code{static_assert} builtin. These builtins and macros differ
|
||||||
from @code{verify} in two major ways. First, they can also be used
|
from @code{verify} in two major ways. First, they can also be used
|
||||||
within a @code{struct} or @code{union} specifier, in place of an
|
within a @code{struct} or @code{union} specifier, in place of an
|
||||||
ordinary member declaration. Second, they require the programmer to
|
ordinary member declaration. Second, they require the programmer to
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* A substitute for ISO C 1x <stdalign.h>.
|
/* A substitute for ISO C11 <stdalign.h>.
|
||||||
|
|
||||||
Copyright 2011-2012 Free Software Foundation, Inc.
|
Copyright 2011-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
@@ -21,12 +21,14 @@
|
|||||||
#ifndef _GL_STDALIGN_H
|
#ifndef _GL_STDALIGN_H
|
||||||
#define _GL_STDALIGN_H
|
#define _GL_STDALIGN_H
|
||||||
|
|
||||||
/* ISO C1X <stdalign.h> for platforms that lack it.
|
/* ISO C11 <stdalign.h> for platforms that lack it.
|
||||||
|
|
||||||
References:
|
References:
|
||||||
ISO C1X <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>
|
ISO C11 (latest free draft
|
||||||
|
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
|
||||||
sections 6.5.3.4, 6.7.5, 7.15.
|
sections 6.5.3.4, 6.7.5, 7.15.
|
||||||
C++0X <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>
|
C++11 (latest free draft
|
||||||
|
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
|
||||||
section 18.10. */
|
section 18.10. */
|
||||||
|
|
||||||
/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
|
/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
|
||||||
@@ -68,7 +70,7 @@
|
|||||||
To be portable to Sun C 5.11, do not align auto variables to
|
To be portable to Sun C 5.11, do not align auto variables to
|
||||||
anything stricter than their default alignment.
|
anything stricter than their default alignment.
|
||||||
|
|
||||||
The following draft C1X requirements are not supported here:
|
The following C11 requirements are not supported here:
|
||||||
|
|
||||||
- If A is zero, alignas has no effect.
|
- If A is zero, alignas has no effect.
|
||||||
- alignas can be used multiple times; the strictest one wins.
|
- alignas can be used multiple times; the strictest one wins.
|
||||||
|
14
lib/verify.h
14
lib/verify.h
@@ -21,13 +21,11 @@
|
|||||||
# define _GL_VERIFY_H
|
# define _GL_VERIFY_H
|
||||||
|
|
||||||
|
|
||||||
/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the
|
/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
|
||||||
C1X draft N1548 section 6.7.10. This is supported by GCC 4.6.0 and
|
This is supported by GCC 4.6.0 and later, in C mode, and its use
|
||||||
later, in C mode, and its use here generates easier-to-read diagnostics
|
here generates easier-to-read diagnostics when verify (R) fails.
|
||||||
when verify (R) fails.
|
|
||||||
|
|
||||||
Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per the
|
Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
|
||||||
C++0X draft N3242 section 7.(4).
|
|
||||||
This will likely be supported by future GCC versions, in C++ mode.
|
This will likely be supported by future GCC versions, in C++ mode.
|
||||||
|
|
||||||
Use this only with GCC. If we were willing to slow 'configure'
|
Use this only with GCC. If we were willing to slow 'configure'
|
||||||
@@ -188,7 +186,7 @@ template <int w>
|
|||||||
trailing ';'. If R is false, fail at compile-time, preferably
|
trailing ';'. If R is false, fail at compile-time, preferably
|
||||||
with a diagnostic that includes the string-literal DIAGNOSTIC.
|
with a diagnostic that includes the string-literal DIAGNOSTIC.
|
||||||
|
|
||||||
Unfortunately, unlike C1X, this implementation must appear as an
|
Unfortunately, unlike C11, this implementation must appear as an
|
||||||
ordinary declaration, and cannot appear inside struct { ... }. */
|
ordinary declaration, and cannot appear inside struct { ... }. */
|
||||||
|
|
||||||
# ifdef _GL_HAVE__STATIC_ASSERT
|
# ifdef _GL_HAVE__STATIC_ASSERT
|
||||||
@@ -205,7 +203,7 @@ template <int w>
|
|||||||
# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
|
# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
|
||||||
# endif
|
# endif
|
||||||
# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
|
# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
|
||||||
# define static_assert _Static_assert /* Draft C1X requires this #define. */
|
# define static_assert _Static_assert /* C11 requires this #define. */
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# gnulib-common.m4 serial 31
|
# gnulib-common.m4 serial 32
|
||||||
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
@@ -13,7 +13,7 @@ AC_DEFUN([gl_COMMON], [
|
|||||||
])
|
])
|
||||||
AC_DEFUN([gl_COMMON_BODY], [
|
AC_DEFUN([gl_COMMON_BODY], [
|
||||||
AH_VERBATIM([_Noreturn],
|
AH_VERBATIM([_Noreturn],
|
||||||
[/* The _Noreturn keyword of draft C1X. */
|
[/* The _Noreturn keyword of C11. */
|
||||||
#ifndef _Noreturn
|
#ifndef _Noreturn
|
||||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||||
|| 0x5110 <= __SUNPRO_C)
|
|| 0x5110 <= __SUNPRO_C)
|
||||||
@@ -224,7 +224,7 @@ m4_ifndef([AS_VAR_IF],
|
|||||||
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
|
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
|
||||||
# to CC twice
|
# to CC twice
|
||||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
|
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
|
||||||
# - AC_PROG_CC_STDC is likely to change when C1X is an ISO standard.
|
# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
|
||||||
AC_DEFUN([gl_PROG_CC_C99],
|
AC_DEFUN([gl_PROG_CC_C99],
|
||||||
[
|
[
|
||||||
dnl Change that version number to the minimum Autoconf version that supports
|
dnl Change that version number to the minimum Autoconf version that supports
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Check for stdalign.h that conforms to C1x.
|
# Check for stdalign.h that conforms to C11.
|
||||||
|
|
||||||
dnl Copyright 2011-2012 Free Software Foundation, Inc.
|
dnl Copyright 2011-2012 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Description:
|
Description:
|
||||||
An <assert.h> that conforms to C1X.
|
An <assert.h> that conforms to C11.
|
||||||
|
|
||||||
Files:
|
Files:
|
||||||
lib/assert.in.h
|
lib/assert.in.h
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Description:
|
Description:
|
||||||
The _Noreturn keyword of C1X.
|
The _Noreturn keyword of C11.
|
||||||
|
|
||||||
Applicability:
|
Applicability:
|
||||||
all
|
all
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Description:
|
Description:
|
||||||
A <stdalign.h> that nearly conforms to ISO C1X and C++0X.
|
A <stdalign.h> that nearly conforms to ISO C11 and C++11.
|
||||||
|
|
||||||
Files:
|
Files:
|
||||||
lib/stdalign.in.h
|
lib/stdalign.in.h
|
||||||
|
Reference in New Issue
Block a user