1. Introduction to the C Compiler
2. C-Compiler Implementation-Specific Information
7. Converting Applications for a 64-Bit Environment
8. cscope: Interactively Examining a C Program
A. Compiler Options Grouped by Functionality
B. C Compiler Options Reference
C. Implementation-Defined ISO/IEC C99 Behavior
E. Implementation-Defined ISO/IEC C90 Behavior
E.1 Implementation Compared to the ISO Standard
E.1.1.1 (5.1.1.3) Identification of diagnostics:
E.1.2.1 (5.1.2.2.1) Semantics of arguments to main:
E.1.2.2 (5.1.2.3) What constitutes an interactive device:
E.1.4.2 (5.2.1.2) The shift states used for the encoding of multibyte characters:
E.1.4.3 (5.2.4.2.1) The number of bits in a character in the execution character set:
E.1.4.8 (6.2.1.1) Whether a plain char has the same range of values as signed char or unsigned char:
E.1.5.1 (6.1.2.5) The representations and sets of values of the various types of integers:
E.1.5.3 (6.3) The results of bitwise operations on signed integers:
E.1.5.4 (6.3.5) The sign of the remainder on integer division:
E.1.5.5 (6.3.7) The result of a right shift of a negative-valued signed integral type:
E.1.7 Arrays and Pointers (G.3.7)
E.1.7.2 (6.3.4) The result of casting a pointer to an integer, or vice versa:
E.1.9 Structures, Unions, Enumerations, and Bit-Fields (G.3.9)
E.1.9.1 (6.3.2.3) A member of a union object is accessed using a member of a different type:
E.1.9.2 (6.5.2.1) The padding and alignment of members of structures.
E.1.9.4 (6.5.2.1) The order of allocation of bit-fields within an int:
E.1.9.5 (6.5.2.1) Whether a bit-field can straddle a storage-unit boundary:
E.1.9.6 (6.5.2.2) The integer type chosen to represent the values of an enumeration type:
E.1.10.1 (6.5.5.3) What constitutes an access to an object that has volatile-qualified type:
E.1.12.1 (6.6.4.2) The maximum number of case values in a switch statement:
E.1.13 Preprocessing Directives (G.3.13)
E.1.13.2 (6.8.1) Whether such a character constant may have a negative value:
E.1.13.3 (6.8.2) The method for locating includable source files:
E.1.13.4 (6.8.2) The support of quoted names for includable source files:
E.1.13.5 (6.8.2) The mapping of source file character sequences:
E.1.13.6 (6.8.6) The behavior on each recognized #pragma directive:
E.1.14 Library Functions (G.3.14)
E.1.14.1 (7.1.6) The null pointer constant to which the macro NULL expands:
E.1.14.2 (7.2) The diagnostic printed by and the termination behavior of the assert function:
E.1.14.4 (7.5.1) The values returned by the mathematics functions on domain errors:
E.1.14.7 (7.7.1.1) The set of signals for the signal function:
E.1.14.11 (7.9.2) Whether the last line of a text stream requires a terminating new-line character:
E.1.14.16 (7.9.3) The characteristics of file buffering:
E.1.14.17 (7.9.3) Whether a zero-length file actually exists:
E.1.14.18 (7.9.3) The rules for composing valid file names:
E.1.14.19 (7.9.3) Whether the same file can be open multiple times:
E.1.14.20 (7.9.4.1) The effect of the remove function on an open file:
E.1.14.22 (7.9.6.1) The output for %p conversion in the fprintf function:
E.1.14.23 (7.9.6.2) The input for %p conversion in the fscanf function:
E.1.15 Locale-Specific Behavior (G.4)
E.1.15.1 (7.12.1) The local time zone and Daylight Savings Time:
E.1.15.2 (7.12.2.1) The era for the clock function
E.1.15.3 (5.2.1) The content of the execution character set, in addition to the required members:
E.1.15.4 (5.2.2) The direction of printing:
E.1.15.5 (7.1.1) The decimal-point character:
E.1.15.6 (7.3) The implementation-defined aspects of character testing and case mapping functions:
E.1.15.7 (7.11.4.4) The collation sequence of the execution character set:
H. The Differences Between K&R Solaris Studio C and Solaris Studio ISO C
The numbers in parentheses correspond to section numbers in the ISO/IEC 9899:1990 standard.
Error messages have the following format:
filename, line line number: message
Warning messages have the following format:
filename, line line number: warning message
Where:
filename is the name of the file containing the error or warning
line number is the number of the line on which the error or warning is found
message is the diagnostic message
int main (int argc, char *argv[]) { .... }
argc is the number of command-line arguments with which the program is invoked with. After any shell expansion, argc is always equal to at least 1, the name of the program.
argv is an array of pointers to the command-line arguments.
An interactive device is one for which the system library call isatty() returns a nonzero value.
The first 1,023 characters are significant. Identifiers are case-sensitive.
The first 1,023 characters are significant. Identifiers are case-sensitive.
Both sets are identical to the ASCII character sets, plus locale-specific extensions.
There are no shift states.
There are 8 bits in a character for the ASCII portion; locale-specific multiple of 8 bits for locale-specific extended portion.
Mapping is identical between source and execution characters.
It is the numerical value of the rightmost character. For example, ’\q’ equals ’q’. A warning is emitted if such an escape sequence occurs.
A multiple-character constant that is not an escape sequence has a value derived from the numeric values of each character.
The valid locale specified by LC_ALL, LC_CTYPE, or LANG environment variable.
A char is treated as a signed char.
Table E-1 Representations and Sets of Values of Integers
|
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 result of a bitwise operation applied to a signed type is the bitwise 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.
The result is the same sign as the dividend; thus, the remainder of -23/4 is -3.
The result of a right shift is a signed right shift.
Table E-2 Values for a float
|
Table E-3 Values for a double
|
Table E-4 Values for long double
|
Numbers are rounded to the nearest value that can be represented.
Numbers are rounded to the nearest value that can be represented.
unsigned int as defined in stddef.h (for —m32).
unsigned long (for -m64)
The bit pattern does not change for pointers and values of type int, long, unsigned int and unsigned long.
int as defined in stddef.h (for —m32).
long (for -m64)
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 bit pattern stored in the union member is accessed, and the value interpreted, according to the type of the member by which it is accessed.
Table E-5 Padding and Alignment of Structure Members
|
Structure members are padded internally, so that every element is aligned on the appropriate boundary.
Alignment of structures is the same as its more strictly aligned member. For example, a struct with only chars has no alignment restrictions, whereas a struct containing a double compiled with —m64 would be aligned on an 8-byte boundary.
It is treated as an unsigned int.
Bit-fields are allocated within a storage unit from high-order to low-order.
Bit-fields do not straddle storage-unit boundaries.
This is an int.
Each reference to the name of an object constitutes one access to the object.
No limit is imposed by the compiler.
No limit is imposed by the compiler.
A character constant within a preprocessing directive has the same numeric value as it has within any other expression.
Character constants in this context may have negative values .
A file whose name is delimited by < > is searched for first in the directories named by the -I option, and then in the standard directory. The standard directory is /usr/include, unless the -YI option is used to specify a different default location.
A file whose name is delimited by quotes is searched for first in the directory of the source file that contains the #include, then in directories named by the -I option, and last in the standard directory.
If a file name enclosed in < > or double quotes begins with a / character, the file name is interpreted as a path name beginning in the root directory. The search for this file is in the root directory only.
Quoted file names in include directives are supported.
Source file characters are mapped to their corresponding ASCII values.
The following pragmas are supported. See 2.11 Pragmas for more information.
align integer (variable[, variable])
c99 (“implicit” | “no%implicit”)
does_not_read_global_data (funcname [, funcname])
does_not_return (funcname[, funcname])
does_not_write_global_data (funcname[, funcname])
error_messages (on|off|default, tag1[ tag2... tagn])
fini (f1[, f2..., fn])
hdrstop
ident string
init (f1[, f2..., fn])
inline (funcname[, funcname])
int_to_unsigned (funcname)
MP serial_loop
MP serial_loop_nested
MP taskloop
no_inline (funcname[, funcname])
no_warn_missing_parameter_info
nomemorydepend
no_side_effect (funcname[, funcname])
opt_level (funcname[, funcname])
pack(n)
pipeloop(n)
rarely_called (funcname[, funcname])
redefine_extname old_extname new_extname
returns_new_memory (funcname[, funcname])
unknown_control_flow (name[, name])
unroll (unroll_factor)
warn_missing_parameter_info
weak symbol1 [= symbol2]
These macros are always available from the environment.
NULL equals 0.
The diagnostic is:
Assertion failed: statement. file filename, line number
Where:
statement is the statement which failed the assertion
filename is the name of the file containing the failure
line number is the number of the line on which the failure occurs
Table E-6 Character Sets Tested by isalpha, islower, etc.
|
Table E-7 Values Returned on Domain Errors
|
Mathematics functions, except scalbn, set errno to ERANGE when underflow is detected.
In this case, it returns the first argument with domain error.
The following table shows the semantics for each signal as recognized by the signal function:
Table E-8 Semantics for signal Signals
|
See above.
The equivalent of signal(sig,SIG_DFL) is always executed.
Default handling is not reset in SIGILL.
The last line does not need to end in a newline.
All characters appear when the stream is read.
No null characters are appended to a binary stream.
The file position indicator is initially positioned at the end of the file.
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.
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).
A zero-length file does exist since it has a directory entry.
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).
The same file can be opened multiple times.
The file is deleted on the last call which closes the file. A program cannot open a file which has already been removed.
If the file exists, it is removed and the new file is written over the previously existing file.
The output for %p is equivalent to %x.
The input for %p is equivalent to %x.
The- character indicates an inclusive range; thus, [0-9] is equivalent to [0123456789].
The local time zone is set by the environment variable TZ.
The era for the clock is represented as clock ticks with the origin at the beginning of the execution of the program.
The following characteristics of a hosted environment are locale-specific:
Locale-specific (no extension in C locale).
Printing is always left to right.
Locale-specific (“.” in C locale).
Same as 4.3.1.
Locale-specific (ASCII collation in C locale).
Locale-specific. Formats for the C locale are shown in the tables below. The names of the months are:
Table E-9 Names of Months
|
The names of the days of the week are:
Table E-10 Days and Abbreviated Days of the Week
|
The format for time is:
%H:%M:%S
The format for date is:
%m/%d/%y