Go to main content
Oracle® Developer Studio 12.6: C User's Guide

Exit Print View

Updated: July 2017
 
 

Implementation-Defined ISO/IEC C99 Behavior

The ISO/IEC 9899:1999, Programming Languages- C standard specifies the form and establishes the interpretation of programs written in C. However, this standard leaves a number of issues as implementation-defined, that is, as varying from compiler to compiler. This chapter details these areas. The section numbers are provided as part of the headings in this appendix for ready comparison to the ISO/IEC 9899:1999 standard itself:

  • Each section heading uses the same section text and letter.number identifier as found in the ISO standard.

  • Each section provides the requirement (preceded by a bullet) from the ISO standard which describes what it is that the implementation shall define. This requirement is then followed by an explanation of our implementation.

  • To obtain 9899:1999 ISO C behavior specify the -std=c99 or -std=gnu99 flag.

E.1 Implementation-defined Behavior (J.3 )

A conforming implementation is required to document its choice of behavior in each of the areas listed in this subclause. The following are implementation-defined:

E.1.1 Translation (J.3.1 )

  • How a diagnostic is identified (3.10, 5.1.1.3).

    Error and warning messages have the following format:

    filename, line number: message

    Where filename is the name of the file that contains the error or warning,

    line number is the number of the line on which the error or warning is found, and message is the diagnostic message.

  • Whether each non-empty sequence of white-space characters other than new-line is retained or replaced by one space character in translation phase 3 (5.1.1.2).

    A sequence of non-empty characters consisting of a tab (\t), form-feed (\f), or vertical-feed (\v) are replaced by a single space character.

E.1.2 Environment (J.3.2)

  • The mapping between physical source file multi-byte characters and the source character set in translation phase 1 (5.1.1.2).

    There are eight bits in a character for the ASCII portion; locale-specific multiples of eight bits for locale-specific extended portion.

  • The name and type of the function called at program startup in a free-standing environment (5.1.2.1).

    The implementation is hosted environment.

  • The effect of program termination in a free-standing environment (5.1.2.1).

    The implementation is in a hosted environment.

  • An alternative manner in which the main function may be defined (5.1.2.2.1).

    There is no alternative way to define main other than that defined in the standard.

  • The values given to the strings pointed to by the argv argument to main (5.1.2.2.1).

    argv is an array of pointers to the command-line arguments, where argv[0] represents the program name if it is available.

  • What constitutes an interactive device (5.1.2.3).

    An interactive device is one for which the system library call isatty() returns a nonzero value

  • The set of signals, their semantics, and their default handling (7.14).

    The following table shows the semantics for each signal as recognized by the signal function:

Table 84  Semantics of signal Function Signals
Signal Number
Default Event
Semantics of Signal
SIGHUP 1
Exit
hangup
SIGINT 2
Exit
interrupt (rubout)
SIGQUIT 3
Core
quit (ASCII FS)
SIGILL 4
Core
illegal instruction (not reset when caught)
SIGTRAP 5
Core
trace trap (not reset when caught)
SIGIOT 6
Core
IOT instruction
SIGABRT 6
Core
Used by abort
SIGEMT 7
Core
EMT instruction
SIGFPE 8
Core
floating-point exception
SIGKILL 9
Exit
kill (cannot be caught or ignored)
SIGBUS 10
Core
bus error
SIGSEGV 11
Core
segmentation violation
SIGSYS 12
Core
bad argument to system call
SIGPIPE 13
Exit
write on a pipe with no one to read it
SIGALRM 14
Exit
alarm clock
SIGTERM 15
Exit
software termination signal from kill
SIGUSR1 16
Exit
user defined signal 1
SIGUSR2 17
Exit
user defined signal 2
SIGCLD 18
Ignore
child status change
SIGCHLD 18
Ignore
child status change alias (POSIX)
SIGPWR 19
Ignore
power-fail restart
SIGWINCH 20
Ignore
window size change
SIGURG 21
Ignore
urgent socket condition
SIGPOLL 22
Exit
pollable event occurred
SIGIO 22
Sigpoll
socket I/O possible
SIGSTOP 23
Stop
stop (cannot be caught or ignored)
SIGTSTP 24
Stop
user stop requested from tty
SIGCONT 25
Ignore
stopped process has been continued
SIGTTIN 26
Stop
background tty read attempted
SIGTTOU 27
Stop
background tty write attempted
SIGVTALRM 28
Exit
virtual timer expired
SIGPROF 29
Exit
profiling timer expired
SIGXCPU 30
Core
exceeded cpu limit
SIGXFSZ 31
Core
exceeded file size limit
SIGWAITING 32
Ignore
reserved signal no longer used by threading code
SIGLWP 33
Ignore
reserved signal no longer used by threading code
SIGFREEZE 34
Ignore
Checkpoint suspend
SIGTHAW 35
Ignore
Checkpoint resume
SIGCANCEL 36
Ignore
Cancellation signal used by threads library
SIGLOST 37
Ignore
resource lost (record-lock lost)
SIGXRES 38
Ignore
Resource control exceeded (see setrctl(2))
SIGJVM1 39
Ignore
Reserved for Java Virtual Machine 1
SIGJVM2 40
Ignore
Reserved for Java Virtual Machine 2
  • Signal values other than SIGFPE, SIGILL, and SIGSEGV that correspond to a computational exception (7.14.1.1).

    SIGILL, SIGFPE, SIGSEGV, SIGTRAP, SIGBUS, and SIGEMT, see Table 84.

  • Signals for which the equivalent of signal(sig, SIG_IGN); is executed at program startup (7.14.1.1).

    SIGILL, SIGFPE, SIGSEGV, SIGTRAP, SIGBUS, and SIGEMT, see Table 84.

  • The set of environment names and the method for altering the environment list used by the getenv function (7.20.4.5).

    The environment names are listed in the man page environ(5).

  • The manner of execution of the string by the system function (7.20.4.6).

    From the system(3C) man page:

    The system() function causes string to be given to the shell as input, as if string had been typed as a command at a terminal. The invoker waits until the shell has completed, then returns the exit status of the shell in the format specified by waitpid(2).

    If string is a null pointer, system() checks if the shell exists and is executable. If the shell is available, system() returns a non-zero value; otherwise, it returns 0.

E.1.3 Identifiers (J.3.3)

  • Which additional multibyte characters may appear in identifiers and their correspondence to universal character names (6.4.2).

    None

  • The number of significant initial characters in an identifier (5.2.4.1, 6.4.2).

    1023

E.1.4 Characters (J.3.4)

  • The number of bits in a byte (3.6).

    There are 8 bits in a byte.

  • The values of the members of the execution character set (5.2.1).

    Mapping is identical between source and execution characters.

  • The unique value of the member of the execution character set produced for each of the standard alphabetic escape sequences (5.2.2).

Table 85  Standard Alphabetic Escape Sequence Unique Values
Escape Sequence
Unique Value
\a (alert)
7
\b (backspace)
8
\f (form feed)
12
\n (new line)
10
\r (carriage return)
13
\t (horizontal tab)
9
\v (vertical tab)
11
  • The value of a char object into which has been stored any character other than a member of the basic execution character set (6.2.5).

    It is the numerical value of the low order 8 bits associated with the character assigned to the char object.

  • Which of signed char or unsigned char has the same range, representation, and behavior as “plain” char (6.2.5, 6.3.1.1).

    A signed char is treated as a “plain” char.

  • The mapping of members of the source character set (in character constants and string literals) to members of the execution character set (6.4.4.4, 5.1.1.2).

    Mapping is identical between source and execution characters.

  • The value of an integer character constant containing more than one character or containing a character or escape sequence that does not map to a single-byte execution character (6.4.4.4).

    A multiple-character constant that is not an escape sequence has a value derived from the numeric values of each character.

  • The value of a wide character constant containing more than one multibyte character, or containing a multibyte character or escape sequence not represented in the extended execution character set (6.4.4.4).

    A multiple-character wide character constant that is not an escape sequence has a value derived from the numeric values of each character.

  • The current locale used to convert a wide character constant consisting of a single multi-byte character that maps to a member of the extended execution character set into a corresponding wide character code (6.4.4.4).

    The valid locale specified by LC_ALL, LC_CTYPE, or LANG environment variable.

  • The current locale used to convert a wide string literal into corresponding wide character codes (6.4.5).

    The valid locale specified by LC_ALL, LC_CTYPE, or LANG environment variable.

  • The value of a string literal containing a multi-byte character or escape sequence not represented in the execution character set (6.4.5).

    Each byte of the multi-byte character forms a character of the string literal, with a value equivalent to the numerical value of that byte in the multi-byte character.

E.1.5 Integers (J.3.5)

  • Any extended integer types that exist in the implementation (6.2.5).

    None

  • Whether signed integer types are represented using sign and magnitude, two’s complement, or one’s complement, and whether the extraordinary value is a trap representation or an ordinary value (6.2.6.2).

    Signed integer types are represented as two’s complement. Extraordinary value is an ordinary value.

  • The rank of any extended integer type relative to another extended integer type with the same precision (6.3.1.1).

    Not applicable to this implementation.

  • The result of, or the signal raised by, converting an integer to a signed integer type when the value cannot be represented in an object of that type (6.3.1.3).

    When an integer is converted to a shorter signed integer, the low order bits are copied from the longer integer to the shorter signed integer. The result may be negative.

    When an unsigned integer is converted to a signed integer of equal size, the low order bits are copied from the unsigned integer to the signed integer. The result may be negative.

  • The results of some bit-wise operations on signed integers (6.5).

    The result of a bit-wise operation applied to a signed type is the bit-wise operation of the operands, including the sign bit. Thus, each bit in the result is set if—and only if—each of the corresponding bits in both of the operands is set.

E.1.6 Floating point (J.3.6)

  • The accuracy of the floating-point operations and of the library functions in <math.h> and <complex.h> that return floating-point results (5.2.4.2.2).

    The accuracy of floating-point operations is consistent with the settings of FLT_EVAL_METHOD. The accuracy of the library functions in <math.h> and <complex.h> is as specified in the libm(3LIB) man page.

  • The rounding behaviors characterized by non-standard values of FLT_ROUNDS (5.2.4.2.2).

    Not applicable to this implementation.

  • The evaluation methods characterized by non-standard negative values of FLT_EVAL_METHOD (5.2.4.2.2).

    Not applicable to this implementation.

  • The direction of rounding when an integer is converted to a floating-point number that cannot exactly represent the original value (6.3.1.4).

    It honors the prevailing rounding direction mode.

  • The direction of rounding when a floating-point number is converted to a narrower floating-point number (6.3.1.5).

    It honors the prevailing rounding direction mode.

  • How the nearest representable value or the larger or smaller representable value immediately adjacent to the nearest representable value is chosen for certain floating constants (6.4.4.2).

    Floating-point constant is always rounded to the nearest representable value.

  • Whether and how floating expressions are contracted when not disallowed by the FP_CONTRACT pragma (6.5).

    Not applicable to this implementation.

  • The default state for the FENV_ACCESS pragma (7.6.1).

    For -fsimple=0, the default value is ON. Otherwise for all other values of -fsimple, the default value for FENV_ACCESS is OFF.

  • Additional floating-point exceptions, rounding modes, environments, and classifications, and their macro names (7.6, 7.12).

    Not applicable to this implementation.

  • The default state for the FP_CONTRACT pragma (7.12.2).

    For -fsimple=0, the default value is OFF. Otherwise for all other values of -fsimple, the default value for FP_CONTRACT is ON.

  • Whether the “inexact” floating-point exception can be raised when the rounded result actually does equal the mathematical result in an IEC 60559 conformant implementation (F.9).

    Results are indeterminable.

  • Whether the underflow (and ”inexact) floating-point exception can be raised when a result is tiny but not inexact in an IEC 60559 conformant implementation(F.9).

    The hardware does not raise underflow or inexact in such cases when trapping on underflow is disabled (the default).

E.1.7 Arrays and Pointers (J.3.7)

  • The result of converting a pointer to an integer or to 64 bits, vice versa (6.3.2.3).

    The bit pattern does not change when converting pointers and integers. Except when the results cannot be represented in the integer or pointer type, and then the results are undefined.

  • The size of the result of subtracting two pointers to elements of the same array (6.5.6).

    For –m32 int, for –m64 long as defined in stddef.h.

E.1.8 Hints (J.3.8)

  • The extent to which suggestions made by using the register storage-class specifier are effective (6.7.1).

    The number of effective register declarations depends on patterns of use and definition within each function and is bounded by the number of registers available for allocation. Neither the compiler nor the optimizer is required to honor register declarations.

  • The extent to which suggestions made by using the inline function specifier are effective (6.7.4).

    The inline keyword is effective in causing the inlining of code only when using optimization, and only when the optimizer determines it is profitable to inline. See Optimization and Performance Options for a list of optimization options.

E.1.9 Structures, Unions, Enumerations, and Bit-fields (J.3.9)

  • Whether a “plain” int bit-field is treated as signed int bit-field or as an unsigned int bit-field (6.7.2, 6.7.2.1).

    It is treated as an unsigned int.

  • Allowable bit-field types other than _Bool, signed int, and unsigned int (6.7.2.1).

    A bit field can be declared as any integer type.

  • Whether a bit-field can straddle a storage-unit boundary (6.7.2.1).

    Bit-fields do not straddle storage-unit boundaries.

  • The order of allocation of bit-fields within a unit (6.7.2.1).

    Bit-fields are allocated within a storage unit from high-order to low-order.

  • The alignment of non-bit-field members of structures (6.7.2.1). This should present no problem unless binary data written by one implementation is read by another.

Table 86  Padding and Alignment of Structure Members
Type
Alignment Boundary
Byte Alignment
char and _Bool
byte
1
short
halfword
2
int
word
4
long -m32
word
4
long -m64
doubleword
8
float
word
4
double -m64
doubleword
8
double (SPARC) -m32
doubleword
8
double (x86) -m32
doubleword
4
long double (SPARC) -m32
doubleword
8
long double (x86) -m32
word
4
long double -m64
quadword
16
pointer -m32
word
4
pointer -m64
quadword
8
long long —m64
doubleword
8
long long (x86) -m32
word
4
long long (SPARC) -m32
doubleword
8
_Complex float
word
4
_Complex double -m64
doubleword
8
_Complex double (SPARC) -m32
doubleword
8
_Complex double (x86) -m32
doubleword
4
_Complex long double -m64
quadword
16
_Complex long double (SPARC) -m32
quadword
8
_Complex long double (x86) -m32
quadword
4
_Imaginary float
word
4
_Imaginary double -m64
doubleword
8
_Imaginary double (x86) -m32
doubleword
4
_Imaginary (SPARC) -m32
doubleword
8
_Imaginary long double (SPARC) -m32
doubleword
8
_Imaginary long double -m64
quadword
16
_Imaginary long double (x86) -m32
word
4
  • The integer type compatible with each enumerated type (6.7.2.2).

    This is an int.

E.1.10 Qualifiers (J.3.10)

  • What constitutes an access to an object that has volatile-qualified type (6.7.3).

    Each reference to the name of an object constitutes one access to the object.

E.1.11 Preprocessing Directives (J.3.11)

  • How sequences in both forms of header names are mapped to headers or external source file names (6.4.7).

    Source file characters are mapped to their corresponding ASCII values.

  • Whether the value of a character constant in a constant expression that controls conditional inclusion matches the value of the same character constant in the execution character set (6.10.1).

    A character constant within a preprocessing directive has the same numeric value as it has within any other expression.

  • Whether the value of a single-character character constant in a constant expression that controls conditional inclusion may have a negative value (6.10.1).

    Character constants in this context may have negative values.

  • The places that are searched for an included < > delimited header, and how the places are specified other header is identified (6.10.2).

    The location of header files depends upon the options specified on the command line, and in which file the #include directive appears. For more information, see How to Specify Include Files.

  • How the named source file is searched for in an included " " delimited header (6.10.2).

    The location of header files depends upon the options specified on the command line, and in which file the #include directive appears. For more information, see How to Specify Include Files.

  • The method by which preprocessing tokens (possibly resulting from macro expansion) in a #include directive are combined into a header name (6.10.2).

    All the tokens making up the header name (including white space) are treated as the file path used when searching for the header as described in How to Specify Include Files.

  • The nesting limit for #include processing (6.10.2).

    No limit is imposed by the compiler.

  • Whether the # operator inserts a \ character before the \ character that begins a universal character name in a character constant or string literal (6.10.3.2).

    No.

  • The behavior on each recognized non-STDC #pragma directive (6.10.6).

    See Pragmas for a description of the behavior of each recognized non-STDC #pragma directive.

  • The definitions for __DATE__ and __TIME__ when respectively, the date and time of translation are not available (6.10.8).

    These macros are always available from the environment.

E.1.12 Library Functions (J.3.12)

  • Any library facilities available to a free-standing program, other than the minimal set required by clause 4 (5.1.2.1).

    The implementation is on a hosted environment.

  • The format of the diagnostic printed by the assert macro (7.2.1.1).

    The diagnostic is structured as follows:

    Assertion failed: statement. file filename, line number, function name

    statement is the statement which failed the assertion. filename is the value of __FILE__. line number is the value of __LINE__. function name is the value of __func__.

  • The representation of the floating-point status flags stored by the fegetexceptflag function (7.6.2.2).

    Each exception stored in the status flag by fegetexceptflag expands to an integer constant expression with values such that bitwise-inclusive ORs of all combinations of the constants result in distinct values.

  • Whether the feraiseexcept function raises the “inexact” floating-point exception in addition to the “overflow” or “underflow” floating-point exception (7.6.2.3).

    No, “inexact” is not raised.

  • Strings other than “C” and “” that may be passed as the second argument to the setlocale function (7.11.1.1).

    Intentionally left blank.

  • The types defined for float_t and double_t when the value of the FLT_EVAL_METHOD macro is less than zero or greater than two (7.12).

    • For SPARC, the types are as follows:

      typedef float float_t;

      typedef double double_t;

    • For x86 the types are as follows:

      typedef long double float_t;

      typedef long double double_t;

    Domain errors for the mathematics functions, other that those required by this International Standard (7.12.1).

    ilogb(), ilogbf() and ilogbl() raise the invalid exception if the input argument is 0, +/-Inf or NaN.

  • The values returned by the mathematics functions on domain errors (7.12.1).

    The values returned on domain errors are as specified in Annex F of ISO/IEC 9899:1999, Programming Languages - C.

  • The values returned by the mathematics functions on underflow range errors, whether errno is set to the value of the macro ERANGE when the integer expression math_errhandling & MATH_ERRNO is nonzero, and whether the “underflow” floating-point exception is raised when the integer expression math_errhandling & MATH_ERREXCEPT is nonzero. (7.12.1).

    For underflow range errors: if the value can be represented as a subnormal number, the subnormal number is returned; otherwise +-0 is returned as appropriate.

    As for whether errno is set to the value of the macro ERANGE when the integer expression math_errhandling & MATH_ERRNO is nonzero, since (math_errhandling & MATH_ERRNO) == 0 in our implementation, this part does not apply.

    Whether the “underflow” floating-point exception is raised when the integer expression math_errhandling & MATH_ERREXCEPT is nonzero (7.12.1), the exception is raised when a floating-point underflow is coupled with loss of accuracy.

  • Whether a domain error occurs or zero is returned when an fmod function has a second argument of zero(7.12.10.1).

    A domain error occurs.

  • The base-2 logarithm of the modulus used by the remquo functions in reducing the quotient (7.12.10.3).

    31.

  • Whether the equivalent of signal(sig, SIG_DFL); is executed prior to the call of a signal handler, and, if not, the blocking of signals that is performed (7.14.1.1).

    The equivalent of signal(sig, SIG_DFL); is executed prior to the call of a signal handler.

  • The null pointer constant to which the macro NULL expands (7.17).

    NULL expands to 0.

  • Whether the last line of a text stream requires a terminating new-line character (7.19.2).

    The last line does not need to end in a newline.

  • Whether space characters that are written out to a text stream immediately before a new-line character appear when read in (7.19.2).

    All characters appear when the stream is read.

  • The number of null characters that may be appended to data written to a binary stream (7.19.2).

    No null characters are appended to a binary stream.

  • Whether the file position indicator of an append-mode stream is initially positioned at the beginning or end of the file (7.19.3).

    The file position indicator is initially positioned at the end of the file.

  • Whether a write on a text stream causes the associated file to be truncated beyond that point (7.19.3).

    A write on a text stream does not cause a file to be truncated beyond that point unless a hardware device forces it to happen.

  • The characteristics of file buffering (7.19.3).

    Output streams, with the exception of the standard error stream (stderr), are by default-buffered if the output refers to a file, and line-buffered if the output refers to a terminal. The standard error output stream (stderr) is by default unbuffered.

    A buffered output stream saves many characters, and then writes the characters as a block. An unbuffered output stream queues information for immediate writing on the destination file or terminal immediately. Line-buffered output queues each line of output until the line is complete (a newline character is requested).

  • Whether a zero-length file actually exists (7.19.3).

    A zero-length file does exist since it has a directory entry.

  • The rules for composing valid file names (7.19.3).

    A valid file name can be from 1 to 1,023 characters in length and can use all character except the characters null and / (slash).

  • Whether the same file can be simultaneously open multiple times (7.19.3).

    The same file can be opened multiple times.

  • The nature and choice of encodings used for multibyte characters in files (7.19.3).

    The encodings used for multibyte characters are the same for each file.

  • The effect of the remove() function on an open file (7.19.4.1).

    The file is deleted on the last call which closes the file. A program cannot open a file which has already been removed.

  • The effect if a file with the new name exists prior to a call to the rename function (7.19.4.2).

    If the file exists, it is removed and the new file is written over the previously existing file.

  • Whether an open temporary file is removed upon abnormal program termination (7.19.4.3).

    If the process is killed in the period between file creation and unlinking, a permanent file may be left behind. See the freopen(3C) man page.

  • Which changes of mode are permitted (if any), and under what circumstances (7.19.5.4).

    The following changes of mode are permitted, depending upon the access mode of the file descriptor underlying the stream:

    • When + is specified, the file descriptor mode must be O_RDWR.

    • When r is specified, the file descriptor mode must be O_RDONLY or O_RDWR.

    • When a or w is specified, the file descriptor mode must be O_WRONLY or O_RDWR.

      See the freopen(3C) man page.

    The style used to print an infinity or NaN, and the meaning of any n-char or n-wchar sequence printed for a NaN (7.19.6.1, 7.24.2.1).

    [-]Inf, [-]NaN. With F conversion specifier, [-]INF, [-]NAN.

  • The output for %p conversion in the fprintf or fwprintf function (7.19.6.1, 7.24.2.1).

    The output for %p is equivalent to %x.

  • The interpretation of a - character that is neither the first nor the last character, nor the second where a ^ character is the first, in the scanlist for %[ conversion in the fscanf() or fwscanf() function (7.19.6.2, 7.24.2.1).

    If a - is in the scanlist and is not the first character, nor the second where the first character is a ^, nor the last character, it indicates a range of characters to be matched.

    See the fscanf(3C) man page.

  • The set of sequences matched by a %p conversion and the interpretation of the corresponding input item in the fscanf() or fwscanf() function (7.19.6.2, 7.24.2.2).

    Matches the set of sequences that is the same as the set of sequences that is produced by the %p conversion of the corresponding printf(3C) functions. The corresponding argument must be a pointer to a pointer to void. If the input item is a value converted earlier during the same program execution, the pointer that results will compare equal to that value; otherwise the behavior of the %p conversion is undefined.

    See the fscanf(3C) man page.

  • The value to which the macro errno is set by the fgetpos, fsetpos, or ftell functions on failure (7.19.9.1, 7.19.9.3, 7.19.9.4).

    • EBADF The file descriptor underlying stream is not valid. See the fgetpos(3C) man page.

    • ESPIPE The file descriptor underlying stream is associated with a pipe, a FIFO, or a socket. See the fgetpos(3C) man page.

    • EOVERFLOW The current value of the file position cannot be represented correctly in an object of type fpos_t. See the fgetpos(3C) man page.

    • EBADF The file descriptor underlying stream is not valid. See the fsetpos(3C) man page.

    • ESPIPE The file descriptor underlying stream is associated with a pipe, a FIFO, or a socket. See the fsetpos(3C) man page.

    • EBADF The file descriptor underlying stream is not an open file descriptor. See the ftell(3C) man page.

    • ESPIPE The file descriptor underlying stream is associated with a pipe, a FIFO, or a socket. See the ftell(3C) man page.

    • EOVERFLOW The current file offset cannot be represented correctly in an object of type long. See the ftell(3C) man page.

    The meaning of any n-char or n-wchar sequence in a string representing a NaN that is converted by the strtod(), strtof(), strtold(), wcstod(), wcstof(), or wcstold() function (7.20.1.3, 7.24.4.1.1).

    No special meaning is given to the n-char sequence.

  • Whether or not the strtod, strtof, strtold, wcstod, wcstof, or wcstold function sets errno to ERANGE when underflow occurs (7.20.1.3, 7.24.4.1.1).

    Yes, errno is set to ERANGE on underflow.

  • Whether the calloc, malloc, and realloc functions return a null pointer or a pointer to an allocated object when the size requested is zero (7.20.3).

    Either a null pointer or a unique pointer that can be passed to free() is returned.

    See the malloc(3C) man page.

  • Whether open streams with unwritten buffered data are flushed, open streams are closed, or temporary files are removed when the abort or _Exit function is called (7.20.4.1, 7.20.4.4).

    The abnormal termination processing includes at least the effect of fclose(3C) on all open streams. See the abort(3C) man page.

    Open streams are closed and do not flush open streams. See the _Exit(2) man page.

  • The termination status returned to the host environment by the abort, exit, or _Exit function (7.20.4.1, 7.20.4.3, 7.20.4.4).

    The status made available to wait(3C) or waitpid(3C) by abort will be that of a process terminated by the SIGABRT signal. See the abort(3C), exit(1), and _Exit(2) man pages.

    The termination status returned by exit, or _Exit, depends on the what the parent process of the calling process is doing.

    If the parent process of the calling process is executing a wait(3C), wait3(3C), waitid(2), or waitpid(3C), and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN, it is notified of the calling process’s termination and the low-order eight bits (that is, bits 0377) of status are made available to it. If the parent is not waiting, the child’s status is made available to it when the parent subsequently executes wait(), wait3(), waitid(), or waitpid().

  • The value returned by the system function when its argument is not a null pointer (7.20.4.6).

    The exit status of the shell in the format specified by waitpid(3C).

  • The local time zone and Daylight Saving Time (7.23.1).

    The local time zone is set by the environment variable TZ.

  • The range and precision of times representable in clock_t and time_t (7.23).

    The precision of clock_t and time_t is one millionth of a second. The range is -2147483647-1 to 4294967295 millionths of a second on x86 and SPARC-V8. And -9223372036854775807LL-1 to 18446744073709551615 on SPARC-v9.

  • The era for the clock function (7.23.2.1).

    The era for the clock is represented as clock ticks with the origin at the beginning of the execution of the program.

  • The replacement string for the %Z specifier to the strftime, and wcsftime functions in the “C” locale (7.23.3.5, 7.24.5.1).

    The time zone name or abbreviation, or by no characters if no time zone is determinable.

  • Whether or when the trigonometric, hyperbolic, base-e exponential, base-e logarithmic, error, and log gamma functions raise the “inexact” floating-point exception in an IEC 60559 conformant implementation (F.9).

    The inexact exception is generally raised when the result is not exactly representable. The inexact exception can be raised even when the result is exactly representable.

  • Whether the functions in <math.h> honor the rounding direction mode in an IEC 60559 conformant implementation (F.9).

    No attempt is made to force the default rounding direction mode for all functions in <math.h>.

E.1.13 Architecture (J.3.13)

  • The values or expressions assigned to the macros specified in the headers <float.h>, <limits.h>, and <stdint.h> (5.2.4.2, 7.18.2, 7.18.3).

    • Here are the values or expressions for the macros specified in <float.h>:

      #define CHAR_BIT 8 /* max # of bits in a “char” */
      #define SCHAR_MIN (-128) /* min value of a “signed char” */
      #define SCHAR_MAX 127 /* max value of a “signed char” */
      #define CHAR_MIN SCHAR_MIN /* min value of a “char” */
      #define CHAR_MAX SCHAR_MAX /* max value of a “char” */
      #define MB_LEN_MAX 5
      #define SHRT_MIN (-32768) /* min value of a “short int” */
      #define SHRT_MAX 32767 /* max value of a “short int” */
      #define USHRT_MAX 65535 /* max value of “unsigned short int” */
      #define INT_MIN (-2147483647-1) /* min value of an “int” */
      #define INT_MAX 2147483647 /* max value of an “int” */
      #define UINT_MAX 4294967295U /* max value of an “unsigned int” */
      #define LONG_MIN (-2147483647L-1L)
      #define LONG_MAX 2147483647L /* max value of a “long int” */
      #define ULONG_MAX 4294967295UL /* max value of “unsigned long int” */
      #define LLONG_MIN (-9223372036854775807LL-1LL)
      #define LLONG_MAX 9223372036854775807LL
      #define ULLONG_MAX 18446744073709551615ULL
      
      #define FLT_RADIX 2
      #define FLT_MANT_DIG 24
      #define DBL_MANT_DIG 53
      #define LDBL_MANT_DIG 64
      
      #if defined(__sparc)
      #define DECIMAL_DIG 36
      #elif defined(__i386)
      #define DECIMAL_DIG 21
      #endif
      #define FLT_DIG 6
      #define DBL_DIG 15
      #if defined(__sparc)
      #define LDBL_DIG 33
      #elif defined(__i386)
      #define LDBL_DIG 18
      #endif
      
      #define FLT_MIN_EXP (-125)
      #define DBL_MIN_EXP (-1021)
      #define LDBL_MIN_EXP (-16381)
      
      #define FLT_MIN_10_EXP (-37)
      #define DBL_MIN_10_EXP (-307)
      #define LDBL_MIN_10_EXP (-4931)
      
      #define FLT_MAX_EXP (+128)
      #define DBL_MAX_EXP (+1024)
      #define LDBL_MAX_EXP (+16384)
      
      #define FLT_EPSILON 1.192092896E-07F
      #define DBL_EPSILON 2.2204460492503131E-16
      
      #if defined(__sparc)
      #define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L
      #elif defined(__i386)
      #define LDBL_EPSILON 1.0842021724855044340075E-19L
      #endif
      
      #define FLT_MIN 1.175494351E-38F
      #define DBL_MIN 2.2250738585072014E-308
      
      #if defined(__sparc)
      #define LDBL_MIN 3.362103143112093506262677817321752603E-4932L
      #elif defined(__i386)
      #define LDBL_MIN 3.3621031431120935062627E-4932L
      #endif
    • Here are the values or expressions for the macros specified in <limits.h>:

      #define INT8_MAX (127)
      #define INT16_MAX (32767)
      #define INT32_MAX (2147483647)
      #define INT64_MAX (9223372036854775807LL)
      
      #define INT8_MIN (-128)
      #define INT16_MIN (-32767-1)
      #define INT32_MIN (-2147483647-1)
      #define INT64_MIN (-9223372036854775807LL-1)
      
      #define UINT8_MAX (255U)
      #define UINT16_MAX (65535U)
      #define UINT32_MAX (4294967295U)
      #define UINT64_MAX (18446744073709551615ULL)
      
      #define INT_LEAST8_MIN INT8_MIN
      #define INT_LEAST16_MIN INT16_MIN
      #define INT_LEAST32_MIN INT32_MIN
      #define INT_LEAST64_MIN INT64_MIN
      
      #define INT_LEAST8_MAX INT8_MAX
      #define INT_LEAST16_MAX INT16_MAX
      #define INT_LEAST32_MAX INT32_MAX
      #define INT_LEAST64_MAX INT64_MAX
      
      #define UINT_LEAST8_MAX UINT8_MAX
      #define UINT_LEAST16_MAX UINT16_MAX
      #define UINT_LEAST32_MAX UINT32_MAX
      #define UINT_LEAST64_MAX UINT64_MAX
    • Here are the values or expressions for the macros specified in <stdint.h>:

      #define INT_FAST8_MIN INT8_MIN
      #define INT_FAST16_MIN INT16_MIN
      #define INT_FAST32_MIN INT32_MIN
      #define INT_FAST64_MIN INT64_MIN
      
      #define INT_FAST8_MAX INT8_MAX
      #define INT_FAST16_MAX INT16_MAX
      #define INT_FAST32_MAX INT32_MAX
      #define INT_FAST64_MAX INT64_MAX
      
      #define UINT_FAST8_MAX UINT8_MAX
      #define UINT_FAST16_MAX UINT16_MAX
      #define UINT_FAST32_MAX UINT32_MAX
      #define UINT_FAST64_MAX UINT64_MAX
  • The number, order, and encoding of bytes in any object (when not explicitly specified in this International Standard) (6.2.6.1).

    The implementation-defined number, order, and encodings of objects not explicitly specified in the 1999 C standard have been defined elsewhere in this chapter.

  • The value of the result of the sizeof operator (6.5.3.4).

    The following table lists the results for sizeof.

Table 87  Results From the sizeof Operator in Bytes
Type
Size in Bytes
char and _Bool
1
short
2
int
4
long
4
long -m64
8
long long
8
float
4
double
8
long double (SPARC)
16
long double (x86) -m32
12
long double (x86) -m64
16
pointer
4
pointer -m64
8
_Complex float
8
_Complex double
16
_Complex long double (SPARC)
32
_Complex long double (x86) -m32
24
_Complex long double (x86) -m64
32
_Imaginary float
4
_Imaginary double
8
_Imaginary long double (SPARC)
16
_Imaginary long double (x86) -m32
12
_Imaginary long double (x86) -m64
16

E.1.14 Locale-specific Behavior (J.4)

The following characteristics of a hosted environment are locale-specific and are required to be documented by the implementation:

  • Additional members of the source and execution character sets beyond the basic character set (5.2.1).

    Locale-specific (no extension in C locale).

  • The presence, meaning, and representation of additional multibyte characters in the execution character set beyond the basic character set (5.2.1.2).

    There are no multibyte characters present in the execution characters set in the default or C locales.

  • The shift states used for the encoding of multibyte characters (5.2.1.2).

    There are no shift states.

  • The direction of writing of successive printing characters (5.2.2).

    Printing is always left to right.

  • The decimal-point character (7.1.1).

    Locale-specific (“.” in C locale).

  • The set of printing characters (7.4, 7.25.2).

    Locale-specific (“.” in C locale).

  • The set of control characters (7.4, 7.25.2).

    The control character set is comprised of horizontal tab, vertical tab, form feed, alert, backspace, carriage return, and new line.

  • The sets of characters tested for by the isalpha, isblank, islower, ispunct, isspace, isupper, iswalpha, iswblank, iswlower, iswpunct, iswspace, or iswupper functions (7.4.1.2, 7.4.1.3, 7.4.1.7, 7.4.1.9, 7.4.1.10, 7.4.1.11, 7.25.2.1.2, 7.25.2.1.3, 7.25.2.1.7, 7.25.2.1.9, 7.25.2.1.10, 7.25.2.1.11).

    See the isalpha(3C) and iswalpha(3C) man pages for descriptions of isalpha() and iswalpha() as well as information on the related macros mentioned above. Note that their behaviors can be modified by changing locale.

  • The native environment (7.11.1.1).

    The native environment is specified by the LANG and LC_* environment variables as described in the setlocale(3C) man page. However, if these environment variables are not set, the native environment is set to the C locale.

  • Additional subject sequences accepted by the numeric conversion functions (7.20.1, 7.24.4.1).

    The radix character is defined in the program’s locale (category LC_NUMERIC), and may be defined as something other than a period (.).

  • The collation sequence of the execution character set (7.21.4.3, 7.24.4.4.2).

    Locale-specific (ASCII collation in C locale).

  • The contents of the error message strings set up by the strerror function (7.21.6.2).

    If the application is linked with -lintl, then messages returned by this function are in the native language specified by the LC_MESSAGES locale category. Otherwise they are in the C locale.

  • The formats for time and date (7.23.3.5, 7.24.5.1).

    Locale-specific. Formats for the C locale are shown in the tables below.

    The names of the months are specified below:

Table 88  The Names of the Months
January
May
September
February
June
October
March
July
November
April
August
December

The names of the days of the week are specified below:

Table 89  Days and Abbreviated Days of the Week
Days
Abbreviated Days
Sunday Thursday
Sun Thu
Monday Friday
Mon Fri
Tuesday Saturday
Tue Sat
Wednesday
Wed

The format for time is:

%H:%M:%S

The format for date is:

%m/%d/ with the -pedantic flag.

The formats for AM and PM designation are: AM PM.

  • Character mappings that are supported by the towctrans function (7.25.1).

    The rules of the coded character set defined by character mapping information in the program’s locale (category LC_CTYPE) may provide for character mappings other than tolower and toupper. Refer to the Oracle Solaris Internationalization Guide For Developers, for details of available locales and their definitions.

  • Character classifications that are supported by the iswctype function (7.25.1).

    See the Oracle Solaris Internationalization Guide For Developers, for details of available locales and any non-standard reserved character classifications