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 (SPARC) (x86).
Integer |
Bits |
Minimum |
Maximum |
---|---|---|---|
char (SPARC) (x86) |
8 |
-128 |
127 |
signed char |
8 |
-128 |
127 |
unsigned char |
8 |
0 |
255 |
short |
16 |
-32768 |
32767 |
signed short |
16 |
-32768 |
32767 |
unsigned short |
16 |
0 |
65535 |
int |
32 |
-2147483648 |
2147483647 |
signed int |
32 |
-2147483648 |
2147483647 |
unsigned int |
32 |
0 |
4294967295 |
long (SPARC) v8 |
32 |
-2147483648 |
2147483647 |
long (SPARC) v9 |
64 |
-9223372036854775808 |
9223372036854775807 |
signed long (SPARC) v8 |
32 |
-2147483648 |
2147483647 |
signed long (SPARC) v9 |
64 |
-9223372036854775808 |
9223372036854775807 |
unsigned long (SPARC) v8 |
32 |
0 |
4294967295 |
unsigned long (SPARC) v9 |
64 |
0 |
18446744073709551615 |
long long |
64 |
-9223372036854775808 |
9223372036854775807 |
64 |
-9223372036854775808 |
9223372036854775807 |
|
unsigned long long |
64 |
0 |
18446744073709551615 |
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.
float |
|
Bits |
32 |
Min |
1.17549435E-38 |
Max |
3.40282347E+38 |
Epsilon |
1.19209290E-07 |
Table E–3 Values for a double
double |
|
Bits |
64 |
Min |
2.2250738585072014E-308 |
Max |
1.7976931348623157E+308 |
Epsilon |
2.2204460492503131E-16 |
Table E–4 Values for long double
long double |
|
Bits |
128 (SPARC) 80 (x86) |
Min |
3.362103143112093506262677817321752603E-4932 (SPARC) 3.3621031431120935062627E-4932 (x86) |
Max |
1.189731495357231765085759326628007016E+4932 (SPARC) 1.1897314953572317650213E4932 (x86) |
Epsilon |
1.925929944387235853055977942584927319E-34 (SPARC) 1.0842021724855044340075E-19 (x86) |
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.
unsigned long for -Xarch=v9
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.
long for -Xarch=v9
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.
Type |
Alignment Boundary |
Byte Alignment |
---|---|---|
char |
Byte |
1 |
short |
Halfword |
2 |
int |
Word |
4 |
long (SPARC) v8 |
Word |
4 |
long (SPARC) v9 |
Doubleword |
8 |
float (SPARC) |
Word |
4 |
double (SPARC) |
Doubleword (SPARC) Word (x86) |
8 (SPARC) 4 (x86) |
long double (SPARC) v8 |
Doubleword (SPARC) Word (x86) |
8 (SPARC) 4 (x86) |
long double (SPARC) v9 |
Quadword |
16 |
pointer (SPARC) v8 |
Word |
4 |
pointer (SPARC) v9 |
Quadword |
8 |
long long |
Doubleword (SPARC) Word (x86) |
8 (SPARC) 4 (x86) |
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 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 (SPARC) (x86).
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 begins 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.8 Pragmas for more information.
align integer (variable[, variable])
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])
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])
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)
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
isalnum |
ASCII characters A-Z, a-z and 0-9 |
isalpha |
ASCII characters A-Z and a-z, plus locale-specific single-byte letters |
iscntrl |
ASCII characters with value 0-31 and 127 |
islower |
ASCII characters a-z |
isprint |
Locale-specific single-byte printable characters |
isupper |
ASCII characters A-Z |
Error |
Math Functions |
Compiler Modes |
|
---|---|---|---|
|
|
-Xs, -Xt |
-Xa, -Xc |
DOMAIN |
acos(|x|>1) |
0.0 |
0.0 |
DOMAIN |
asin(|x|>1) |
0.0 |
0.0 |
DOMAIN |
atan2(+-0,+-0) |
0.0 |
0.0 |
DOMAIN |
y0(0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
y0(x<0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
y1(0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
y1(x<0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
yn(n,0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
yn(n,x<0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
log(x<0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
log10(x<0) |
-HUGE |
-HUGE_VAL |
DOMAIN |
pow(0,0) |
0.0 |
1.0 |
DOMAIN |
pow(0,neg) |
0.0 |
-HUGE_VAL |
DOMAIN |
pow(neg,non-integal) |
0.0 |
NaN |
DOMAIN |
sqrt(x<0) |
0.0 |
NaN |
DOMAIN |
fmod(x,0) |
x |
NaN |
DOMAIN |
remainder(x,0) |
NaN |
NaN |
DOMAIN |
acosh(x<1) |
NaN |
NaN |
DOMAIN |
atanh(|x|>1) |
NaN |
NaN |
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
Signal |
No. |
Default |
Event |
---|---|---|---|
SIGHUP |
1 |
Exit |
hangup |
SIGINT |
2 |
Exit |
interrupt |
SIGQUIT |
3 |
Core |
quit |
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 |
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 |
Exit |
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 |
SIGWAITINGT |
32 |
Ignore |
process’s lwps are blocked |
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
January |
May |
September |
February |
June |
October |
March |
July |
November |
April |
August |
December |
The names of the days of the week are:
Table E–10 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/%y