diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-03-31 21:30:31 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2009-03-31 21:30:31 +0100 |
commit | 207bf79d7f23a3883694578f431c08960c348e38 (patch) | |
tree | 95ebe0a942d710ca9a7eb0e922e458a37ecf6a02 /gcc/doc | |
parent | e49be8f7c371881733a0f9b0c7ecccef5232f10e (diff) | |
download | gcc-207bf79d7f23a3883694578f431c08960c348e38.zip gcc-207bf79d7f23a3883694578f431c08960c348e38.tar.gz gcc-207bf79d7f23a3883694578f431c08960c348e38.tar.bz2 |
re PR c/448 (<stdint.h>-related issues (C99 issues))
PR c/448
fixincludes:
* inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes.
* fixincl.x: Regenerate.
* tests/base/stdint.h: Update.
gcc:
* Makefile.in (USE_GCC_STDINT): Define.
(stmp-int-hdrs): Install stdint.h if applicable.
* c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE
if known.
(CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known.
(SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE,
UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
(c_common_nodes_and_builtins): Initialize
underlying_wchar_type_node. Do not initialize
signed_wchar_type_node or unsigned_wchar_type_node. Initialize
nodes for new types.
(c_stddef_cpp_builtins): Define macros for new types.
* c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE):
Remove.
(CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE,
CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE,
CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE,
CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE,
CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE,
CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE,
CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE,
CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE,
CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define.
(signed_wchar_type_node, unsigned_wchar_type_node): Remove.
(underlying_wchar_type_node, sig_atomic_type_node, int8_type_node,
int16_type_node, int32_type_node, int64_type_node,
uint8_type_node, uint16_type_node, c_uint32_type_node,
c_uint64_type_node, int_least8_type_node, int_least16_type_node,
int_least32_type_node, int_least64_type_node,
uint_least8_type_node, uint_least16_type_node,
uint_least32_type_node, uint_least64_type_node,
int_fast8_type_node, int_fast16_type_node, int_fast32_type_node,
int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node,
uint_fast32_type_node, uint_fast64_type_node, intptr_type_node,
uintptr_type_node): Define.
* c-cppbuiltin.c (builtin_define_constants,
builtin_define_type_minmax): New.
(builtin_define_stdint_macros): Define more macros.
(c_cpp_builtins): Define more limit macros.
(type_suffix): New.
(builtin_define_type_max): Define in terms of
builtin_define_type_minmax. Remove is_long parameter. All
callers changed.
* config.gcc (use_gcc_stdint): Define.
(tm_file): Add glibc-stdint.h for targets using glibc or uClibc.
Add newlib-stdint.h for generic targets.
* config/glibc-stdint.h, config/newlib-stdint.h,
ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New.
* config/m32c/m32c.h (UINTPTR_TYPE): Define.
* config/score/score.h (UINTPTR_TYPE): Define.
* config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE,
INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE,
UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
* config/spu/spu.h (STDINT_LONG32): Define.
* configure.ac (use_gcc_stdint): Substitute.
* configure: Regenerate.
* doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__,
__INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__,
__UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__,
__INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__,
__INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__,
__UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__,
__INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__,
__UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__,
__UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__,
__WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__,
__SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__,
__INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__,
__UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__,
__INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__,
__UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__,
__INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__,
__INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__,
__UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__,
__UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__,
__INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C,
__UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document.
* doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE,
INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_stdint_types):
Update comment.
(check_effective_target_inttypes_types): New.
* gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c,
gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c,
gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests.
From-SVN: r145372
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/cpp.texi | 123 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 45 |
2 files changed, 157 insertions, 11 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 0eaece1..d79991c 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -11,7 +11,8 @@ @copying @c man begin COPYRIGHT Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, -1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +2008, 2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document @@ -2117,13 +2118,50 @@ OSF/rose @option{-mno-underscores} option). @itemx __WINT_TYPE__ @itemx __INTMAX_TYPE__ @itemx __UINTMAX_TYPE__ +@itemx __SIG_ATOMIC_TYPE__ +@itemx __INT8_TYPE__ +@itemx __INT16_TYPE__ +@itemx __INT32_TYPE__ +@itemx __INT64_TYPE__ +@itemx __UINT8_TYPE__ +@itemx __UINT16_TYPE__ +@itemx __UINT32_TYPE__ +@itemx __UINT64_TYPE__ +@itemx __INT_LEAST8_TYPE__ +@itemx __INT_LEAST16_TYPE__ +@itemx __INT_LEAST32_TYPE__ +@itemx __INT_LEAST64_TYPE__ +@itemx __UINT_LEAST8_TYPE__ +@itemx __UINT_LEAST16_TYPE__ +@itemx __UINT_LEAST32_TYPE__ +@itemx __UINT_LEAST64_TYPE__ +@itemx __INT_FAST8_TYPE__ +@itemx __INT_FAST16_TYPE__ +@itemx __INT_FAST32_TYPE__ +@itemx __INT_FAST64_TYPE__ +@itemx __UINT_FAST8_TYPE__ +@itemx __UINT_FAST16_TYPE__ +@itemx __UINT_FAST32_TYPE__ +@itemx __UINT_FAST64_TYPE__ +@itemx __INTPTR_TYPE__ +@itemx __UINTPTR_TYPE__ These macros are defined to the correct underlying types for the @code{size_t}, @code{ptrdiff_t}, @code{wchar_t}, @code{wint_t}, -@code{intmax_t}, and @code{uintmax_t} -typedefs, respectively. They exist to make the standard header files -@file{stddef.h} and @file{wchar.h} work correctly. You should not use -these macros directly; instead, include the appropriate headers and use -the typedefs. +@code{intmax_t}, @code{uintmax_t}, @code{sig_atomic_t}, @code{int8_t}, +@code{int16_t}, @code{int32_t}, @code{int64_t}, @code{uint8_t}, +@code{uint16_t}, @code{uint32_t}, @code{uint64_t}, +@code{int_least8_t}, @code{int_least16_t}, @code{int_least32_t}, +@code{int_least64_t}, @code{uint_least8_t}, @code{uint_least16_t}, +@code{uint_least32_t}, @code{uint_least64_t}, @code{int_fast8_t}, +@code{int_fast16_t}, @code{int_fast32_t}, @code{int_fast64_t}, +@code{uint_fast8_t}, @code{uint_fast16_t}, @code{uint_fast32_t}, +@code{uint_fast64_t}, @code{intptr_t}, and @code{uintptr_t} typedefs, +respectively. They exist to make the standard header files +@file{stddef.h}, @file{stdint.h}, and @file{wchar.h} work correctly. +You should not use these macros directly; instead, include the +appropriate headers and use the typedefs. Some of these macros may +not be defined on particular systems if GCC does not provide a +@file{stdint.h} header on those systems. @item __CHAR_BIT__ Defined to the number of bits used in the representation of the @@ -2137,14 +2175,77 @@ this macro directly; instead, include the appropriate headers. @itemx __INT_MAX__ @itemx __LONG_MAX__ @itemx __LONG_LONG_MAX__ +@itemx __WINT_MAX__ +@itemx __SIZE_MAX__ +@itemx __PTRDIFF_MAX__ @itemx __INTMAX_MAX__ +@itemx __UINTMAX_MAX__ +@itemx __SIG_ATOMIC_MAX__ +@itemx __INT8_MAX__ +@itemx __INT16_MAX__ +@itemx __INT32_MAX__ +@itemx __INT64_MAX__ +@itemx __UINT8_MAX__ +@itemx __UINT16_MAX__ +@itemx __UINT32_MAX__ +@itemx __UINT64_MAX__ +@itemx __INT_LEAST8_MAX__ +@itemx __INT_LEAST16_MAX__ +@itemx __INT_LEAST32_MAX__ +@itemx __INT_LEAST64_MAX__ +@itemx __UINT_LEAST8_MAX__ +@itemx __UINT_LEAST16_MAX__ +@itemx __UINT_LEAST32_MAX__ +@itemx __UINT_LEAST64_MAX__ +@itemx __INT_FAST8_MAX__ +@itemx __INT_FAST16_MAX__ +@itemx __INT_FAST32_MAX__ +@itemx __INT_FAST64_MAX__ +@itemx __UINT_FAST8_MAX__ +@itemx __UINT_FAST16_MAX__ +@itemx __UINT_FAST32_MAX__ +@itemx __UINT_FAST64_MAX__ +@itemx __INTPTR_MAX__ +@itemx __UINTPTR_MAX__ +@itemx __WCHAR_MIN__ +@itemx __WINT_MIN__ +@itemx __SIG_ATOMIC_MIN__ Defined to the maximum value of the @code{signed char}, @code{wchar_t}, @code{signed short}, -@code{signed int}, @code{signed long}, @code{signed long long}, and -@code{intmax_t} types -respectively. They exist to make the standard header given numerical limits -work correctly. You should not use these macros directly; instead, include -the appropriate headers. +@code{signed int}, @code{signed long}, @code{signed long long}, +@code{wint_t}, @code{size_t}, @code{ptrdiff_t}, +@code{intmax_t}, @code{uintmax_t}, @code{sig_atomic_t}, @code{int8_t}, +@code{int16_t}, @code{int32_t}, @code{int64_t}, @code{uint8_t}, +@code{uint16_t}, @code{uint32_t}, @code{uint64_t}, +@code{int_least8_t}, @code{int_least16_t}, @code{int_least32_t}, +@code{int_least64_t}, @code{uint_least8_t}, @code{uint_least16_t}, +@code{uint_least32_t}, @code{uint_least64_t}, @code{int_fast8_t}, +@code{int_fast16_t}, @code{int_fast32_t}, @code{int_fast64_t}, +@code{uint_fast8_t}, @code{uint_fast16_t}, @code{uint_fast32_t}, +@code{uint_fast64_t}, @code{intptr_t}, and @code{uintptr_t} types and +to the minimum value of the @code{wchar_t}, @code{wint_t}, and +@code{sig_atomic_t} types respectively. They exist to make the +standard header given numerical limits work correctly. You should not +use these macros directly; instead, include the appropriate headers. +Some of these macros may not be defined on particular systems if GCC +does not provide a @file{stdint.h} header on those systems. + +@item __INT8_C +@itemx __INT16_C +@itemx __INT32_C +@itemx __INT64_C +@itemx __UINT8_C +@itemx __UINT16_C +@itemx __UINT32_C +@itemx __UINT64_C +@itemx __INTMAX_C +@itemx __UINTMAX_C +Defined to implementations of the standard @file{stdint.h} macros with +the same names without the leading @code{__}. They exist the make the +implementation of that header work correctly. You should not use +these macros directly; instead, include the appropriate headers. Some +of these macros may not be defined on particular systems if GCC does +not provide a @file{stdint.h} header on those systems. @item __SIZEOF_INT__ @itemx __SIZEOF_LONG__ diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index f4680b6..665b269 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1782,6 +1782,51 @@ unsigned int"} that has as much precision as @code{long long unsigned int}. @end defmac +@defmac SIG_ATOMIC_TYPE +@defmacx INT8_TYPE +@defmacx INT16_TYPE +@defmacx INT32_TYPE +@defmacx INT64_TYPE +@defmacx UINT8_TYPE +@defmacx UINT16_TYPE +@defmacx UINT32_TYPE +@defmacx UINT64_TYPE +@defmacx INT_LEAST8_TYPE +@defmacx INT_LEAST16_TYPE +@defmacx INT_LEAST32_TYPE +@defmacx INT_LEAST64_TYPE +@defmacx UINT_LEAST8_TYPE +@defmacx UINT_LEAST16_TYPE +@defmacx UINT_LEAST32_TYPE +@defmacx UINT_LEAST64_TYPE +@defmacx INT_FAST8_TYPE +@defmacx INT_FAST16_TYPE +@defmacx INT_FAST32_TYPE +@defmacx INT_FAST64_TYPE +@defmacx UINT_FAST8_TYPE +@defmacx UINT_FAST16_TYPE +@defmacx UINT_FAST32_TYPE +@defmacx UINT_FAST64_TYPE +@defmacx INTPTR_TYPE +@defmacx UINTPTR_TYPE +C expressions for the standard types @code{sig_atomic_t}, +@code{int8_t}, @code{int16_t}, @code{int32_t}, @code{int64_t}, +@code{uint8_t}, @code{uint16_t}, @code{uint32_t}, @code{uint64_t}, +@code{int_least8_t}, @code{int_least16_t}, @code{int_least32_t}, +@code{int_least64_t}, @code{uint_least8_t}, @code{uint_least16_t}, +@code{uint_least32_t}, @code{uint_least64_t}, @code{int_fast8_t}, +@code{int_fast16_t}, @code{int_fast32_t}, @code{int_fast64_t}, +@code{uint_fast8_t}, @code{uint_fast16_t}, @code{uint_fast32_t}, +@code{uint_fast64_t}, @code{intptr_t}, and @code{uintptr_t}. See +@code{SIZE_TYPE} above for more information. + +If any of these macros evaluates to a null pointer, the corresponding +type is not supported; if GCC is configured to provide +@code{<stdint.h>} in such a case, the header provided may not conform +to C99, depending on the type in question. The defaults for all of +these macros are null pointers. +@end defmac + @defmac TARGET_PTRMEMFUNC_VBIT_LOCATION The C++ compiler represents a pointer-to-member-function with a struct that looks like: |