1*e4b17023SJohn Marino@c Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 2*e4b17023SJohn Marino@c Free Software Foundation, Inc. 3*e4b17023SJohn Marino@c This is part of the GCC manual. 4*e4b17023SJohn Marino@c For copying conditions, see the file gcc.texi. 5*e4b17023SJohn Marino 6*e4b17023SJohn Marino@node C Implementation 7*e4b17023SJohn Marino@chapter C Implementation-defined behavior 8*e4b17023SJohn Marino@cindex implementation-defined behavior, C language 9*e4b17023SJohn Marino 10*e4b17023SJohn MarinoA conforming implementation of ISO C is required to document its 11*e4b17023SJohn Marinochoice of behavior in each of the areas that are designated 12*e4b17023SJohn Marino``implementation defined''. The following lists all such areas, 13*e4b17023SJohn Marinoalong with the section numbers from the ISO/IEC 9899:1990 and ISO/IEC 14*e4b17023SJohn Marino9899:1999 standards. Some areas are only implementation-defined in 15*e4b17023SJohn Marinoone version of the standard. 16*e4b17023SJohn Marino 17*e4b17023SJohn MarinoSome choices depend on the externally determined ABI for the platform 18*e4b17023SJohn Marino(including standard character encodings) which GCC follows; these are 19*e4b17023SJohn Marinolisted as ``determined by ABI'' below. @xref{Compatibility, , Binary 20*e4b17023SJohn MarinoCompatibility}, and @uref{http://gcc.gnu.org/readings.html}. Some 21*e4b17023SJohn Marinochoices are documented in the preprocessor manual. 22*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 23*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. Some choices are made by the 24*e4b17023SJohn Marinolibrary and operating system (or other environment when compiling for 25*e4b17023SJohn Marinoa freestanding environment); refer to their documentation for details. 26*e4b17023SJohn Marino 27*e4b17023SJohn Marino@menu 28*e4b17023SJohn Marino* Translation implementation:: 29*e4b17023SJohn Marino* Environment implementation:: 30*e4b17023SJohn Marino* Identifiers implementation:: 31*e4b17023SJohn Marino* Characters implementation:: 32*e4b17023SJohn Marino* Integers implementation:: 33*e4b17023SJohn Marino* Floating point implementation:: 34*e4b17023SJohn Marino* Arrays and pointers implementation:: 35*e4b17023SJohn Marino* Hints implementation:: 36*e4b17023SJohn Marino* Structures unions enumerations and bit-fields implementation:: 37*e4b17023SJohn Marino* Qualifiers implementation:: 38*e4b17023SJohn Marino* Declarators implementation:: 39*e4b17023SJohn Marino* Statements implementation:: 40*e4b17023SJohn Marino* Preprocessing directives implementation:: 41*e4b17023SJohn Marino* Library functions implementation:: 42*e4b17023SJohn Marino* Architecture implementation:: 43*e4b17023SJohn Marino* Locale-specific behavior implementation:: 44*e4b17023SJohn Marino@end menu 45*e4b17023SJohn Marino 46*e4b17023SJohn Marino@node Translation implementation 47*e4b17023SJohn Marino@section Translation 48*e4b17023SJohn Marino 49*e4b17023SJohn Marino@itemize @bullet 50*e4b17023SJohn Marino@item 51*e4b17023SJohn Marino@cite{How a diagnostic is identified (C90 3.7, C99 3.10, C90 and C99 5.1.1.3).} 52*e4b17023SJohn Marino 53*e4b17023SJohn MarinoDiagnostics consist of all the output sent to stderr by GCC@. 54*e4b17023SJohn Marino 55*e4b17023SJohn Marino@item 56*e4b17023SJohn Marino@cite{Whether each nonempty sequence of white-space characters other than 57*e4b17023SJohn Marinonew-line is retained or replaced by one space character in translation 58*e4b17023SJohn Marinophase 3 (C90 and C99 5.1.1.2).} 59*e4b17023SJohn Marino 60*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 61*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 62*e4b17023SJohn Marino 63*e4b17023SJohn Marino@end itemize 64*e4b17023SJohn Marino 65*e4b17023SJohn Marino@node Environment implementation 66*e4b17023SJohn Marino@section Environment 67*e4b17023SJohn Marino 68*e4b17023SJohn MarinoThe behavior of most of these points are dependent on the implementation 69*e4b17023SJohn Marinoof the C library, and are not defined by GCC itself. 70*e4b17023SJohn Marino 71*e4b17023SJohn Marino@itemize @bullet 72*e4b17023SJohn Marino@item 73*e4b17023SJohn Marino@cite{The mapping between physical source file multibyte characters 74*e4b17023SJohn Marinoand the source character set in translation phase 1 (C90 and C99 5.1.1.2).} 75*e4b17023SJohn Marino 76*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 77*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 78*e4b17023SJohn Marino 79*e4b17023SJohn Marino@end itemize 80*e4b17023SJohn Marino 81*e4b17023SJohn Marino@node Identifiers implementation 82*e4b17023SJohn Marino@section Identifiers 83*e4b17023SJohn Marino 84*e4b17023SJohn Marino@itemize @bullet 85*e4b17023SJohn Marino@item 86*e4b17023SJohn Marino@cite{Which additional multibyte characters may appear in identifiers 87*e4b17023SJohn Marinoand their correspondence to universal character names (C99 6.4.2).} 88*e4b17023SJohn Marino 89*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 90*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 91*e4b17023SJohn Marino 92*e4b17023SJohn Marino@item 93*e4b17023SJohn Marino@cite{The number of significant initial characters in an identifier 94*e4b17023SJohn Marino(C90 6.1.2, C90 and C99 5.2.4.1, C99 6.4.2).} 95*e4b17023SJohn Marino 96*e4b17023SJohn MarinoFor internal names, all characters are significant. For external names, 97*e4b17023SJohn Marinothe number of significant characters are defined by the linker; for 98*e4b17023SJohn Marinoalmost all targets, all characters are significant. 99*e4b17023SJohn Marino 100*e4b17023SJohn Marino@item 101*e4b17023SJohn Marino@cite{Whether case distinctions are significant in an identifier with 102*e4b17023SJohn Marinoexternal linkage (C90 6.1.2).} 103*e4b17023SJohn Marino 104*e4b17023SJohn MarinoThis is a property of the linker. C99 requires that case distinctions 105*e4b17023SJohn Marinoare always significant in identifiers with external linkage and 106*e4b17023SJohn Marinosystems without this property are not supported by GCC@. 107*e4b17023SJohn Marino 108*e4b17023SJohn Marino@end itemize 109*e4b17023SJohn Marino 110*e4b17023SJohn Marino@node Characters implementation 111*e4b17023SJohn Marino@section Characters 112*e4b17023SJohn Marino 113*e4b17023SJohn Marino@itemize @bullet 114*e4b17023SJohn Marino@item 115*e4b17023SJohn Marino@cite{The number of bits in a byte (C90 3.4, C99 3.6).} 116*e4b17023SJohn Marino 117*e4b17023SJohn MarinoDetermined by ABI@. 118*e4b17023SJohn Marino 119*e4b17023SJohn Marino@item 120*e4b17023SJohn Marino@cite{The values of the members of the execution character set (C90 121*e4b17023SJohn Marinoand C99 5.2.1).} 122*e4b17023SJohn Marino 123*e4b17023SJohn MarinoDetermined by ABI@. 124*e4b17023SJohn Marino 125*e4b17023SJohn Marino@item 126*e4b17023SJohn Marino@cite{The unique value of the member of the execution character set produced 127*e4b17023SJohn Marinofor each of the standard alphabetic escape sequences (C90 and C99 5.2.2).} 128*e4b17023SJohn Marino 129*e4b17023SJohn MarinoDetermined by ABI@. 130*e4b17023SJohn Marino 131*e4b17023SJohn Marino@item 132*e4b17023SJohn Marino@cite{The value of a @code{char} object into which has been stored any 133*e4b17023SJohn Marinocharacter other than a member of the basic execution character set 134*e4b17023SJohn Marino(C90 6.1.2.5, C99 6.2.5).} 135*e4b17023SJohn Marino 136*e4b17023SJohn MarinoDetermined by ABI@. 137*e4b17023SJohn Marino 138*e4b17023SJohn Marino@item 139*e4b17023SJohn Marino@cite{Which of @code{signed char} or @code{unsigned char} has the same 140*e4b17023SJohn Marinorange, representation, and behavior as ``plain'' @code{char} (C90 141*e4b17023SJohn Marino6.1.2.5, C90 6.2.1.1, C99 6.2.5, C99 6.3.1.1).} 142*e4b17023SJohn Marino 143*e4b17023SJohn Marino@opindex fsigned-char 144*e4b17023SJohn Marino@opindex funsigned-char 145*e4b17023SJohn MarinoDetermined by ABI@. The options @option{-funsigned-char} and 146*e4b17023SJohn Marino@option{-fsigned-char} change the default. @xref{C Dialect Options, , 147*e4b17023SJohn MarinoOptions Controlling C Dialect}. 148*e4b17023SJohn Marino 149*e4b17023SJohn Marino@item 150*e4b17023SJohn Marino@cite{The mapping of members of the source character set (in character 151*e4b17023SJohn Marinoconstants and string literals) to members of the execution character 152*e4b17023SJohn Marinoset (C90 6.1.3.4, C99 6.4.4.4, C90 and C99 5.1.1.2).} 153*e4b17023SJohn Marino 154*e4b17023SJohn MarinoDetermined by ABI@. 155*e4b17023SJohn Marino 156*e4b17023SJohn Marino@item 157*e4b17023SJohn Marino@cite{The value of an integer character constant containing more than one 158*e4b17023SJohn Marinocharacter or containing a character or escape sequence that does not map 159*e4b17023SJohn Marinoto a single-byte execution character (C90 6.1.3.4, C99 6.4.4.4).} 160*e4b17023SJohn Marino 161*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 162*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 163*e4b17023SJohn Marino 164*e4b17023SJohn Marino@item 165*e4b17023SJohn Marino@cite{The value of a wide character constant containing more than one 166*e4b17023SJohn Marinomultibyte character, or containing a multibyte character or escape 167*e4b17023SJohn Marinosequence not represented in the extended execution character set (C90 168*e4b17023SJohn Marino6.1.3.4, C99 6.4.4.4).} 169*e4b17023SJohn Marino 170*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 171*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 172*e4b17023SJohn Marino 173*e4b17023SJohn Marino@item 174*e4b17023SJohn Marino@cite{The current locale used to convert a wide character constant consisting 175*e4b17023SJohn Marinoof a single multibyte character that maps to a member of the extended 176*e4b17023SJohn Marinoexecution character set into a corresponding wide character code (C90 177*e4b17023SJohn Marino6.1.3.4, C99 6.4.4.4).} 178*e4b17023SJohn Marino 179*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 180*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 181*e4b17023SJohn Marino 182*e4b17023SJohn Marino@item 183*e4b17023SJohn Marino@cite{The current locale used to convert a wide string literal into 184*e4b17023SJohn Marinocorresponding wide character codes (C90 6.1.4, C99 6.4.5).} 185*e4b17023SJohn Marino 186*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 187*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 188*e4b17023SJohn Marino 189*e4b17023SJohn Marino@item 190*e4b17023SJohn Marino@cite{The value of a string literal containing a multibyte character or escape 191*e4b17023SJohn Marinosequence not represented in the execution character set (C90 6.1.4, C99 6.4.5).} 192*e4b17023SJohn Marino 193*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 194*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}. 195*e4b17023SJohn Marino@end itemize 196*e4b17023SJohn Marino 197*e4b17023SJohn Marino@node Integers implementation 198*e4b17023SJohn Marino@section Integers 199*e4b17023SJohn Marino 200*e4b17023SJohn Marino@itemize @bullet 201*e4b17023SJohn Marino@item 202*e4b17023SJohn Marino@cite{Any extended integer types that exist in the implementation (C99 6.2.5).} 203*e4b17023SJohn Marino 204*e4b17023SJohn MarinoGCC does not support any extended integer types. 205*e4b17023SJohn Marino@c The __mode__ attribute might create types of precisions not 206*e4b17023SJohn Marino@c otherwise supported, but the syntax isn't right for use everywhere 207*e4b17023SJohn Marino@c the standard type names might be used. Predefined typedefs should 208*e4b17023SJohn Marino@c be used if any extended integer types are to be defined. The 209*e4b17023SJohn Marino@c __int128_t and __uint128_t typedefs are not extended integer types 210*e4b17023SJohn Marino@c as they are generally longer than the ABI-specified intmax_t. 211*e4b17023SJohn Marino 212*e4b17023SJohn Marino@item 213*e4b17023SJohn Marino@cite{Whether signed integer types are represented using sign and magnitude, 214*e4b17023SJohn Marinotwo's complement, or one's complement, and whether the extraordinary value 215*e4b17023SJohn Marinois a trap representation or an ordinary value (C99 6.2.6.2).} 216*e4b17023SJohn Marino 217*e4b17023SJohn MarinoGCC supports only two's complement integer types, and all bit patterns 218*e4b17023SJohn Marinoare ordinary values. 219*e4b17023SJohn Marino 220*e4b17023SJohn Marino@item 221*e4b17023SJohn Marino@cite{The rank of any extended integer type relative to another extended 222*e4b17023SJohn Marinointeger type with the same precision (C99 6.3.1.1).} 223*e4b17023SJohn Marino 224*e4b17023SJohn MarinoGCC does not support any extended integer types. 225*e4b17023SJohn Marino@c If it did, there would only be one of each precision and signedness. 226*e4b17023SJohn Marino 227*e4b17023SJohn Marino@item 228*e4b17023SJohn Marino@cite{The result of, or the signal raised by, converting an integer to a 229*e4b17023SJohn Marinosigned integer type when the value cannot be represented in an object of 230*e4b17023SJohn Marinothat type (C90 6.2.1.2, C99 6.3.1.3).} 231*e4b17023SJohn Marino 232*e4b17023SJohn MarinoFor conversion to a type of width @math{N}, the value is reduced 233*e4b17023SJohn Marinomodulo @math{2^N} to be within range of the type; no signal is raised. 234*e4b17023SJohn Marino 235*e4b17023SJohn Marino@item 236*e4b17023SJohn Marino@cite{The results of some bitwise operations on signed integers (C90 237*e4b17023SJohn Marino6.3, C99 6.5).} 238*e4b17023SJohn Marino 239*e4b17023SJohn MarinoBitwise operators act on the representation of the value including 240*e4b17023SJohn Marinoboth the sign and value bits, where the sign bit is considered 241*e4b17023SJohn Marinoimmediately above the highest-value value bit. Signed @samp{>>} acts 242*e4b17023SJohn Marinoon negative numbers by sign extension. 243*e4b17023SJohn Marino 244*e4b17023SJohn MarinoGCC does not use the latitude given in C99 only to treat certain 245*e4b17023SJohn Marinoaspects of signed @samp{<<} as undefined, but this is subject to 246*e4b17023SJohn Marinochange. 247*e4b17023SJohn Marino 248*e4b17023SJohn Marino@item 249*e4b17023SJohn Marino@cite{The sign of the remainder on integer division (C90 6.3.5).} 250*e4b17023SJohn Marino 251*e4b17023SJohn MarinoGCC always follows the C99 requirement that the result of division is 252*e4b17023SJohn Marinotruncated towards zero. 253*e4b17023SJohn Marino 254*e4b17023SJohn Marino@end itemize 255*e4b17023SJohn Marino 256*e4b17023SJohn Marino@node Floating point implementation 257*e4b17023SJohn Marino@section Floating point 258*e4b17023SJohn Marino 259*e4b17023SJohn Marino@itemize @bullet 260*e4b17023SJohn Marino@item 261*e4b17023SJohn Marino@cite{The accuracy of the floating-point operations and of the library 262*e4b17023SJohn Marinofunctions in @code{<math.h>} and @code{<complex.h>} that return floating-point 263*e4b17023SJohn Marinoresults (C90 and C99 5.2.4.2.2).} 264*e4b17023SJohn Marino 265*e4b17023SJohn MarinoThe accuracy is unknown. 266*e4b17023SJohn Marino 267*e4b17023SJohn Marino@item 268*e4b17023SJohn Marino@cite{The rounding behaviors characterized by non-standard values 269*e4b17023SJohn Marinoof @code{FLT_ROUNDS} @gol 270*e4b17023SJohn Marino(C90 and C99 5.2.4.2.2).} 271*e4b17023SJohn Marino 272*e4b17023SJohn MarinoGCC does not use such values. 273*e4b17023SJohn Marino 274*e4b17023SJohn Marino@item 275*e4b17023SJohn Marino@cite{The evaluation methods characterized by non-standard negative 276*e4b17023SJohn Marinovalues of @code{FLT_EVAL_METHOD} (C99 5.2.4.2.2).} 277*e4b17023SJohn Marino 278*e4b17023SJohn MarinoGCC does not use such values. 279*e4b17023SJohn Marino 280*e4b17023SJohn Marino@item 281*e4b17023SJohn Marino@cite{The direction of rounding when an integer is converted to a 282*e4b17023SJohn Marinofloating-point number that cannot exactly represent the original 283*e4b17023SJohn Marinovalue (C90 6.2.1.3, C99 6.3.1.4).} 284*e4b17023SJohn Marino 285*e4b17023SJohn MarinoC99 Annex F is followed. 286*e4b17023SJohn Marino 287*e4b17023SJohn Marino@item 288*e4b17023SJohn Marino@cite{The direction of rounding when a floating-point number is 289*e4b17023SJohn Marinoconverted to a narrower floating-point number (C90 6.2.1.4, C99 290*e4b17023SJohn Marino6.3.1.5).} 291*e4b17023SJohn Marino 292*e4b17023SJohn MarinoC99 Annex F is followed. 293*e4b17023SJohn Marino 294*e4b17023SJohn Marino@item 295*e4b17023SJohn Marino@cite{How the nearest representable value or the larger or smaller 296*e4b17023SJohn Marinorepresentable value immediately adjacent to the nearest representable 297*e4b17023SJohn Marinovalue is chosen for certain floating constants (C90 6.1.3.1, C99 298*e4b17023SJohn Marino6.4.4.2).} 299*e4b17023SJohn Marino 300*e4b17023SJohn MarinoC99 Annex F is followed. 301*e4b17023SJohn Marino 302*e4b17023SJohn Marino@item 303*e4b17023SJohn Marino@cite{Whether and how floating expressions are contracted when not 304*e4b17023SJohn Marinodisallowed by the @code{FP_CONTRACT} pragma (C99 6.5).} 305*e4b17023SJohn Marino 306*e4b17023SJohn MarinoExpressions are currently only contracted if 307*e4b17023SJohn Marino@option{-funsafe-math-optimizations} or @option{-ffast-math} are used. 308*e4b17023SJohn MarinoThis is subject to change. 309*e4b17023SJohn Marino 310*e4b17023SJohn Marino@item 311*e4b17023SJohn Marino@cite{The default state for the @code{FENV_ACCESS} pragma (C99 7.6.1).} 312*e4b17023SJohn Marino 313*e4b17023SJohn MarinoThis pragma is not implemented, but the default is to ``off'' unless 314*e4b17023SJohn Marino@option{-frounding-math} is used in which case it is ``on''. 315*e4b17023SJohn Marino 316*e4b17023SJohn Marino@item 317*e4b17023SJohn Marino@cite{Additional floating-point exceptions, rounding modes, environments, 318*e4b17023SJohn Marinoand classifications, and their macro names (C99 7.6, C99 7.12).} 319*e4b17023SJohn Marino 320*e4b17023SJohn MarinoThis is dependent on the implementation of the C library, and is not 321*e4b17023SJohn Marinodefined by GCC itself. 322*e4b17023SJohn Marino 323*e4b17023SJohn Marino@item 324*e4b17023SJohn Marino@cite{The default state for the @code{FP_CONTRACT} pragma (C99 7.12.2).} 325*e4b17023SJohn Marino 326*e4b17023SJohn MarinoThis pragma is not implemented. Expressions are currently only 327*e4b17023SJohn Marinocontracted if @option{-funsafe-math-optimizations} or 328*e4b17023SJohn Marino@option{-ffast-math} are used. This is subject to change. 329*e4b17023SJohn Marino 330*e4b17023SJohn Marino@item 331*e4b17023SJohn Marino@cite{Whether the ``inexact'' floating-point exception can be raised 332*e4b17023SJohn Marinowhen the rounded result actually does equal the mathematical result 333*e4b17023SJohn Marinoin an IEC 60559 conformant implementation (C99 F.9).} 334*e4b17023SJohn Marino 335*e4b17023SJohn MarinoThis is dependent on the implementation of the C library, and is not 336*e4b17023SJohn Marinodefined by GCC itself. 337*e4b17023SJohn Marino 338*e4b17023SJohn Marino@item 339*e4b17023SJohn Marino@cite{Whether the ``underflow'' (and ``inexact'') floating-point 340*e4b17023SJohn Marinoexception can be raised when a result is tiny but not inexact in an 341*e4b17023SJohn MarinoIEC 60559 conformant implementation (C99 F.9).} 342*e4b17023SJohn Marino 343*e4b17023SJohn MarinoThis is dependent on the implementation of the C library, and is not 344*e4b17023SJohn Marinodefined by GCC itself. 345*e4b17023SJohn Marino 346*e4b17023SJohn Marino@end itemize 347*e4b17023SJohn Marino 348*e4b17023SJohn Marino@node Arrays and pointers implementation 349*e4b17023SJohn Marino@section Arrays and pointers 350*e4b17023SJohn Marino 351*e4b17023SJohn Marino@itemize @bullet 352*e4b17023SJohn Marino@item 353*e4b17023SJohn Marino@cite{The result of converting a pointer to an integer or 354*e4b17023SJohn Marinovice versa (C90 6.3.4, C99 6.3.2.3).} 355*e4b17023SJohn Marino 356*e4b17023SJohn MarinoA cast from pointer to integer discards most-significant bits if the 357*e4b17023SJohn Marinopointer representation is larger than the integer type, 358*e4b17023SJohn Marinosign-extends@footnote{Future versions of GCC may zero-extend, or use 359*e4b17023SJohn Marinoa target-defined @code{ptr_extend} pattern. Do not rely on sign extension.} 360*e4b17023SJohn Marinoif the pointer representation is smaller than the integer type, otherwise 361*e4b17023SJohn Marinothe bits are unchanged. 362*e4b17023SJohn Marino@c ??? We've always claimed that pointers were unsigned entities. 363*e4b17023SJohn Marino@c Shouldn't we therefore be doing zero-extension? If so, the bug 364*e4b17023SJohn Marino@c is in convert_to_integer, where we call type_for_size and request 365*e4b17023SJohn Marino@c a signed integral type. On the other hand, it might be most useful 366*e4b17023SJohn Marino@c for the target if we extend according to POINTERS_EXTEND_UNSIGNED. 367*e4b17023SJohn Marino 368*e4b17023SJohn MarinoA cast from integer to pointer discards most-significant bits if the 369*e4b17023SJohn Marinopointer representation is smaller than the integer type, extends according 370*e4b17023SJohn Marinoto the signedness of the integer type if the pointer representation 371*e4b17023SJohn Marinois larger than the integer type, otherwise the bits are unchanged. 372*e4b17023SJohn Marino 373*e4b17023SJohn MarinoWhen casting from pointer to integer and back again, the resulting 374*e4b17023SJohn Marinopointer must reference the same object as the original pointer, otherwise 375*e4b17023SJohn Marinothe behavior is undefined. That is, one may not use integer arithmetic to 376*e4b17023SJohn Marinoavoid the undefined behavior of pointer arithmetic as proscribed in 377*e4b17023SJohn MarinoC99 6.5.6/8. 378*e4b17023SJohn Marino 379*e4b17023SJohn Marino@item 380*e4b17023SJohn Marino@cite{The size of the result of subtracting two pointers to elements 381*e4b17023SJohn Marinoof the same array (C90 6.3.6, C99 6.5.6).} 382*e4b17023SJohn Marino 383*e4b17023SJohn MarinoThe value is as specified in the standard and the type is determined 384*e4b17023SJohn Marinoby the ABI@. 385*e4b17023SJohn Marino 386*e4b17023SJohn Marino@end itemize 387*e4b17023SJohn Marino 388*e4b17023SJohn Marino@node Hints implementation 389*e4b17023SJohn Marino@section Hints 390*e4b17023SJohn Marino 391*e4b17023SJohn Marino@itemize @bullet 392*e4b17023SJohn Marino@item 393*e4b17023SJohn Marino@cite{The extent to which suggestions made by using the @code{register} 394*e4b17023SJohn Marinostorage-class specifier are effective (C90 6.5.1, C99 6.7.1).} 395*e4b17023SJohn Marino 396*e4b17023SJohn MarinoThe @code{register} specifier affects code generation only in these ways: 397*e4b17023SJohn Marino 398*e4b17023SJohn Marino@itemize @bullet 399*e4b17023SJohn Marino@item 400*e4b17023SJohn MarinoWhen used as part of the register variable extension, see 401*e4b17023SJohn Marino@ref{Explicit Reg Vars}. 402*e4b17023SJohn Marino 403*e4b17023SJohn Marino@item 404*e4b17023SJohn MarinoWhen @option{-O0} is in use, the compiler allocates distinct stack 405*e4b17023SJohn Marinomemory for all variables that do not have the @code{register} 406*e4b17023SJohn Marinostorage-class specifier; if @code{register} is specified, the variable 407*e4b17023SJohn Marinomay have a shorter lifespan than the code would indicate and may never 408*e4b17023SJohn Marinobe placed in memory. 409*e4b17023SJohn Marino 410*e4b17023SJohn Marino@item 411*e4b17023SJohn MarinoOn some rare x86 targets, @code{setjmp} doesn't save the registers in 412*e4b17023SJohn Marinoall circumstances. In those cases, GCC doesn't allocate any variables 413*e4b17023SJohn Marinoin registers unless they are marked @code{register}. 414*e4b17023SJohn Marino 415*e4b17023SJohn Marino@end itemize 416*e4b17023SJohn Marino 417*e4b17023SJohn Marino@item 418*e4b17023SJohn Marino@cite{The extent to which suggestions made by using the inline function 419*e4b17023SJohn Marinospecifier are effective (C99 6.7.4).} 420*e4b17023SJohn Marino 421*e4b17023SJohn MarinoGCC will not inline any functions if the @option{-fno-inline} option is 422*e4b17023SJohn Marinoused or if @option{-O0} is used. Otherwise, GCC may still be unable to 423*e4b17023SJohn Marinoinline a function for many reasons; the @option{-Winline} option may be 424*e4b17023SJohn Marinoused to determine if a function has not been inlined and why not. 425*e4b17023SJohn Marino 426*e4b17023SJohn Marino@end itemize 427*e4b17023SJohn Marino 428*e4b17023SJohn Marino@node Structures unions enumerations and bit-fields implementation 429*e4b17023SJohn Marino@section Structures, unions, enumerations, and bit-fields 430*e4b17023SJohn Marino 431*e4b17023SJohn Marino@itemize @bullet 432*e4b17023SJohn Marino@item 433*e4b17023SJohn Marino@cite{A member of a union object is accessed using a member of a 434*e4b17023SJohn Marinodifferent type (C90 6.3.2.3).} 435*e4b17023SJohn Marino 436*e4b17023SJohn MarinoThe relevant bytes of the representation of the object are treated as 437*e4b17023SJohn Marinoan object of the type used for the access. @xref{Type-punning}. This 438*e4b17023SJohn Marinomay be a trap representation. 439*e4b17023SJohn Marino 440*e4b17023SJohn Marino@item 441*e4b17023SJohn Marino@cite{Whether a ``plain'' @code{int} bit-field is treated as a 442*e4b17023SJohn Marino@code{signed int} bit-field or as an @code{unsigned int} bit-field 443*e4b17023SJohn Marino(C90 6.5.2, C90 6.5.2.1, C99 6.7.2, C99 6.7.2.1).} 444*e4b17023SJohn Marino 445*e4b17023SJohn Marino@opindex funsigned-bitfields 446*e4b17023SJohn MarinoBy default it is treated as @code{signed int} but this may be changed 447*e4b17023SJohn Marinoby the @option{-funsigned-bitfields} option. 448*e4b17023SJohn Marino 449*e4b17023SJohn Marino@item 450*e4b17023SJohn Marino@cite{Allowable bit-field types other than @code{_Bool}, @code{signed int}, 451*e4b17023SJohn Marinoand @code{unsigned int} (C99 6.7.2.1).} 452*e4b17023SJohn Marino 453*e4b17023SJohn MarinoNo other types are permitted in strictly conforming mode. 454*e4b17023SJohn Marino@c Would it be better to restrict the pedwarn for other types to C90 455*e4b17023SJohn Marino@c mode and document the other types for C99 mode? 456*e4b17023SJohn Marino 457*e4b17023SJohn Marino@item 458*e4b17023SJohn Marino@cite{Whether a bit-field can straddle a storage-unit boundary (C90 459*e4b17023SJohn Marino6.5.2.1, C99 6.7.2.1).} 460*e4b17023SJohn Marino 461*e4b17023SJohn MarinoDetermined by ABI@. 462*e4b17023SJohn Marino 463*e4b17023SJohn Marino@item 464*e4b17023SJohn Marino@cite{The order of allocation of bit-fields within a unit (C90 465*e4b17023SJohn Marino6.5.2.1, C99 6.7.2.1).} 466*e4b17023SJohn Marino 467*e4b17023SJohn MarinoDetermined by ABI@. 468*e4b17023SJohn Marino 469*e4b17023SJohn Marino@item 470*e4b17023SJohn Marino@cite{The alignment of non-bit-field members of structures (C90 471*e4b17023SJohn Marino6.5.2.1, C99 6.7.2.1).} 472*e4b17023SJohn Marino 473*e4b17023SJohn MarinoDetermined by ABI@. 474*e4b17023SJohn Marino 475*e4b17023SJohn Marino@item 476*e4b17023SJohn Marino@cite{The integer type compatible with each enumerated type (C90 477*e4b17023SJohn Marino6.5.2.2, C99 6.7.2.2).} 478*e4b17023SJohn Marino 479*e4b17023SJohn Marino@opindex fshort-enums 480*e4b17023SJohn MarinoNormally, the type is @code{unsigned int} if there are no negative 481*e4b17023SJohn Marinovalues in the enumeration, otherwise @code{int}. If 482*e4b17023SJohn Marino@option{-fshort-enums} is specified, then if there are negative values 483*e4b17023SJohn Marinoit is the first of @code{signed char}, @code{short} and @code{int} 484*e4b17023SJohn Marinothat can represent all the values, otherwise it is the first of 485*e4b17023SJohn Marino@code{unsigned char}, @code{unsigned short} and @code{unsigned int} 486*e4b17023SJohn Marinothat can represent all the values. 487*e4b17023SJohn Marino@c On a few unusual targets with 64-bit int, this doesn't agree with 488*e4b17023SJohn Marino@c the code and one of the types accessed via mode attributes (which 489*e4b17023SJohn Marino@c are not currently considered extended integer types) may be used. 490*e4b17023SJohn Marino@c If these types are made extended integer types, it would still be 491*e4b17023SJohn Marino@c the case that -fshort-enums stops the implementation from 492*e4b17023SJohn Marino@c conforming to C90 on those targets. 493*e4b17023SJohn Marino 494*e4b17023SJohn MarinoOn some targets, @option{-fshort-enums} is the default; this is 495*e4b17023SJohn Marinodetermined by the ABI@. 496*e4b17023SJohn Marino 497*e4b17023SJohn Marino@end itemize 498*e4b17023SJohn Marino 499*e4b17023SJohn Marino@node Qualifiers implementation 500*e4b17023SJohn Marino@section Qualifiers 501*e4b17023SJohn Marino 502*e4b17023SJohn Marino@itemize @bullet 503*e4b17023SJohn Marino@item 504*e4b17023SJohn Marino@cite{What constitutes an access to an object that has volatile-qualified 505*e4b17023SJohn Marinotype (C90 6.5.3, C99 6.7.3).} 506*e4b17023SJohn Marino 507*e4b17023SJohn MarinoSuch an object is normally accessed by pointers and used for accessing 508*e4b17023SJohn Marinohardware. In most expressions, it is intuitively obvious what is a read 509*e4b17023SJohn Marinoand what is a write. For example 510*e4b17023SJohn Marino 511*e4b17023SJohn Marino@smallexample 512*e4b17023SJohn Marinovolatile int *dst = @var{somevalue}; 513*e4b17023SJohn Marinovolatile int *src = @var{someothervalue}; 514*e4b17023SJohn Marino*dst = *src; 515*e4b17023SJohn Marino@end smallexample 516*e4b17023SJohn Marino 517*e4b17023SJohn Marino@noindent 518*e4b17023SJohn Marinowill cause a read of the volatile object pointed to by @var{src} and store the 519*e4b17023SJohn Marinovalue into the volatile object pointed to by @var{dst}. There is no 520*e4b17023SJohn Marinoguarantee that these reads and writes are atomic, especially for objects 521*e4b17023SJohn Marinolarger than @code{int}. 522*e4b17023SJohn Marino 523*e4b17023SJohn MarinoHowever, if the volatile storage is not being modified, and the value of 524*e4b17023SJohn Marinothe volatile storage is not used, then the situation is less obvious. 525*e4b17023SJohn MarinoFor example 526*e4b17023SJohn Marino 527*e4b17023SJohn Marino@smallexample 528*e4b17023SJohn Marinovolatile int *src = @var{somevalue}; 529*e4b17023SJohn Marino*src; 530*e4b17023SJohn Marino@end smallexample 531*e4b17023SJohn Marino 532*e4b17023SJohn MarinoAccording to the C standard, such an expression is an rvalue whose type 533*e4b17023SJohn Marinois the unqualified version of its original type, i.e. @code{int}. Whether 534*e4b17023SJohn MarinoGCC interprets this as a read of the volatile object being pointed to or 535*e4b17023SJohn Marinoonly as a request to evaluate the expression for its side-effects depends 536*e4b17023SJohn Marinoon this type. 537*e4b17023SJohn Marino 538*e4b17023SJohn MarinoIf it is a scalar type, or on most targets an aggregate type whose only 539*e4b17023SJohn Marinomember object is of a scalar type, or a union type whose member objects 540*e4b17023SJohn Marinoare of scalar types, the expression is interpreted by GCC as a read of 541*e4b17023SJohn Marinothe volatile object; in the other cases, the expression is only evaluated 542*e4b17023SJohn Marinofor its side-effects. 543*e4b17023SJohn Marino 544*e4b17023SJohn Marino@end itemize 545*e4b17023SJohn Marino 546*e4b17023SJohn Marino@node Declarators implementation 547*e4b17023SJohn Marino@section Declarators 548*e4b17023SJohn Marino 549*e4b17023SJohn Marino@itemize @bullet 550*e4b17023SJohn Marino@item 551*e4b17023SJohn Marino@cite{The maximum number of declarators that may modify an arithmetic, 552*e4b17023SJohn Marinostructure or union type (C90 6.5.4).} 553*e4b17023SJohn Marino 554*e4b17023SJohn MarinoGCC is only limited by available memory. 555*e4b17023SJohn Marino 556*e4b17023SJohn Marino@end itemize 557*e4b17023SJohn Marino 558*e4b17023SJohn Marino@node Statements implementation 559*e4b17023SJohn Marino@section Statements 560*e4b17023SJohn Marino 561*e4b17023SJohn Marino@itemize @bullet 562*e4b17023SJohn Marino@item 563*e4b17023SJohn Marino@cite{The maximum number of @code{case} values in a @code{switch} 564*e4b17023SJohn Marinostatement (C90 6.6.4.2).} 565*e4b17023SJohn Marino 566*e4b17023SJohn MarinoGCC is only limited by available memory. 567*e4b17023SJohn Marino 568*e4b17023SJohn Marino@end itemize 569*e4b17023SJohn Marino 570*e4b17023SJohn Marino@node Preprocessing directives implementation 571*e4b17023SJohn Marino@section Preprocessing directives 572*e4b17023SJohn Marino 573*e4b17023SJohn Marino@xref{Implementation-defined behavior, , Implementation-defined 574*e4b17023SJohn Marinobehavior, cpp, The C Preprocessor}, for details of these aspects of 575*e4b17023SJohn Marinoimplementation-defined behavior. 576*e4b17023SJohn Marino 577*e4b17023SJohn Marino@itemize @bullet 578*e4b17023SJohn Marino@item 579*e4b17023SJohn Marino@cite{How sequences in both forms of header names are mapped to headers 580*e4b17023SJohn Marinoor external source file names (C90 6.1.7, C99 6.4.7).} 581*e4b17023SJohn Marino 582*e4b17023SJohn Marino@item 583*e4b17023SJohn Marino@cite{Whether the value of a character constant in a constant expression 584*e4b17023SJohn Marinothat controls conditional inclusion matches the value of the same character 585*e4b17023SJohn Marinoconstant in the execution character set (C90 6.8.1, C99 6.10.1).} 586*e4b17023SJohn Marino 587*e4b17023SJohn Marino@item 588*e4b17023SJohn Marino@cite{Whether the value of a single-character character constant in a 589*e4b17023SJohn Marinoconstant expression that controls conditional inclusion may have a 590*e4b17023SJohn Marinonegative value (C90 6.8.1, C99 6.10.1).} 591*e4b17023SJohn Marino 592*e4b17023SJohn Marino@item 593*e4b17023SJohn Marino@cite{The places that are searched for an included @samp{<>} delimited 594*e4b17023SJohn Marinoheader, and how the places are specified or the header is 595*e4b17023SJohn Marinoidentified (C90 6.8.2, C99 6.10.2).} 596*e4b17023SJohn Marino 597*e4b17023SJohn Marino@item 598*e4b17023SJohn Marino@cite{How the named source file is searched for in an included @samp{""} 599*e4b17023SJohn Marinodelimited header (C90 6.8.2, C99 6.10.2).} 600*e4b17023SJohn Marino 601*e4b17023SJohn Marino@item 602*e4b17023SJohn Marino@cite{The method by which preprocessing tokens (possibly resulting from 603*e4b17023SJohn Marinomacro expansion) in a @code{#include} directive are combined into a header 604*e4b17023SJohn Marinoname (C90 6.8.2, C99 6.10.2).} 605*e4b17023SJohn Marino 606*e4b17023SJohn Marino@item 607*e4b17023SJohn Marino@cite{The nesting limit for @code{#include} processing (C90 6.8.2, C99 608*e4b17023SJohn Marino6.10.2).} 609*e4b17023SJohn Marino 610*e4b17023SJohn Marino@item 611*e4b17023SJohn Marino@cite{Whether the @samp{#} operator inserts a @samp{\} character before 612*e4b17023SJohn Marinothe @samp{\} character that begins a universal character name in a 613*e4b17023SJohn Marinocharacter constant or string literal (C99 6.10.3.2).} 614*e4b17023SJohn Marino 615*e4b17023SJohn Marino@item 616*e4b17023SJohn Marino@cite{The behavior on each recognized non-@code{STDC #pragma} 617*e4b17023SJohn Marinodirective (C90 6.8.6, C99 6.10.6).} 618*e4b17023SJohn Marino 619*e4b17023SJohn Marino@xref{Pragmas, , Pragmas, cpp, The C Preprocessor}, for details of 620*e4b17023SJohn Marinopragmas accepted by GCC on all targets. @xref{Pragmas, , Pragmas 621*e4b17023SJohn MarinoAccepted by GCC}, for details of target-specific pragmas. 622*e4b17023SJohn Marino 623*e4b17023SJohn Marino@item 624*e4b17023SJohn Marino@cite{The definitions for @code{__DATE__} and @code{__TIME__} when 625*e4b17023SJohn Marinorespectively, the date and time of translation are not available (C90 626*e4b17023SJohn Marino6.8.8, C99 6.10.8).} 627*e4b17023SJohn Marino 628*e4b17023SJohn Marino@end itemize 629*e4b17023SJohn Marino 630*e4b17023SJohn Marino@node Library functions implementation 631*e4b17023SJohn Marino@section Library functions 632*e4b17023SJohn Marino 633*e4b17023SJohn MarinoThe behavior of most of these points are dependent on the implementation 634*e4b17023SJohn Marinoof the C library, and are not defined by GCC itself. 635*e4b17023SJohn Marino 636*e4b17023SJohn Marino@itemize @bullet 637*e4b17023SJohn Marino@item 638*e4b17023SJohn Marino@cite{The null pointer constant to which the macro @code{NULL} expands 639*e4b17023SJohn Marino(C90 7.1.6, C99 7.17).} 640*e4b17023SJohn Marino 641*e4b17023SJohn MarinoIn @code{<stddef.h>}, @code{NULL} expands to @code{((void *)0)}. GCC 642*e4b17023SJohn Marinodoes not provide the other headers which define @code{NULL} and some 643*e4b17023SJohn Marinolibrary implementations may use other definitions in those headers. 644*e4b17023SJohn Marino 645*e4b17023SJohn Marino@end itemize 646*e4b17023SJohn Marino 647*e4b17023SJohn Marino@node Architecture implementation 648*e4b17023SJohn Marino@section Architecture 649*e4b17023SJohn Marino 650*e4b17023SJohn Marino@itemize @bullet 651*e4b17023SJohn Marino@item 652*e4b17023SJohn Marino@cite{The values or expressions assigned to the macros specified in the 653*e4b17023SJohn Marinoheaders @code{<float.h>}, @code{<limits.h>}, and @code{<stdint.h>} 654*e4b17023SJohn Marino(C90 and C99 5.2.4.2, C99 7.18.2, C99 7.18.3).} 655*e4b17023SJohn Marino 656*e4b17023SJohn MarinoDetermined by ABI@. 657*e4b17023SJohn Marino 658*e4b17023SJohn Marino@item 659*e4b17023SJohn Marino@cite{The number, order, and encoding of bytes in any object 660*e4b17023SJohn Marino(when not explicitly specified in this International Standard) (C99 6.2.6.1).} 661*e4b17023SJohn Marino 662*e4b17023SJohn MarinoDetermined by ABI@. 663*e4b17023SJohn Marino 664*e4b17023SJohn Marino@item 665*e4b17023SJohn Marino@cite{The value of the result of the @code{sizeof} operator (C90 666*e4b17023SJohn Marino6.3.3.4, C99 6.5.3.4).} 667*e4b17023SJohn Marino 668*e4b17023SJohn MarinoDetermined by ABI@. 669*e4b17023SJohn Marino 670*e4b17023SJohn Marino@end itemize 671*e4b17023SJohn Marino 672*e4b17023SJohn Marino@node Locale-specific behavior implementation 673*e4b17023SJohn Marino@section Locale-specific behavior 674*e4b17023SJohn Marino 675*e4b17023SJohn MarinoThe behavior of these points are dependent on the implementation 676*e4b17023SJohn Marinoof the C library, and are not defined by GCC itself. 677