Implementation-Defined Behavior |
B |
![]() |
This chapter details these areas. They can be readily compared to the ANSI standard itself:
filename, line line number: messageWarning messages have the following format:
filename, line line number: warning messageWhere:
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.
A char is treated as an unsigned char (PowerPC).
1
Not valid in -Xc mode
|
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.
1
Not available in -Xc mode.
|
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.
Character constants in this context may not have negative values (PowerPC).
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.
align integer (variable[,variable])
align:
aint=20900 mod=0
apointer=20980 mod=0
astruct=20880 mod=0
#pragma weak function_name |
#pragma weak function_name1 = function_name2
Assertion failed: statement. file filename, line numberWhere:
(4.7.1.1) The default handling and the handling at program startup for each signal recognized by the signal function:
See above. (4.7.1.1) If the equivalent of signal(sig, SIG_DFL); is not executed prior to the call of a signal handler, the blocking of the signal that is performed:
The equivalent of signal(sig,SIG_DFL) is always executed. (4.7.1.1) Whether the default handling is reset if the SIGILL signal is received by a handler specified to the signal function:
Default handling is not reset in SIGILL.
Streams and Files
(4.9.2) Whether the last line of a text stream requires a terminating new-line character:
The last line does not need to end in a newline. (4.9.2) Whether space characters that are written out to a text stream immediately before a new-line character appear when read in:
All characters appear when the stream is read. (4.9.2) The number of null characters that may be appended to data written to a binary stream:
No null characters are appended to a binary stream. (4.9.3) Whether the file position indicator of an append mode stream is initially positioned at the beginning or end of the file:
The file position indicator is initially positioned at the end of the file. (4.9.3) Whether a write on a text stream causes the associated file to be truncated beyond that point:
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. (4.9.3) The characteristics of file buffering:
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. (4.9.3) Whether a zero-length file actually exists:
A zero-length file does exist since it has a directory entry. (4.9.3) The rules for composing valid file names:
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). (4.9.3) Whether the same file can be open multiple times:
The same file can be opened multiple times. (4.9.4.1) The effect of the remove function on an open file:
The file is deleted on the last call which closes the file. A program cannot open a file which has already been removed. (4.9.4.2) The effect if a file with the new name exists prior to a call to the rename function:
If the file exists, it is removed and the new file is written over the previously existing file. (4.9.6.1) The output for %p conversion in the fprintf function:
The output for %p is equivalent to %x. (4.9.6.2) The input for %p conversion in the fscanf function:
The input for %p is equivalent to %x. (4.9.6.2) The interpretation of a - character that is neither the first nor the last character in the scan list for %[ conversion in the fscanf function:
The - character indicates an inclusive range; thus, [0-9] is equivalent to [0123456789].
errno
(4.9.9.4) The value to which the macro errno is set by the fgetpos or ftell function on failure:
errno is set to EBADF, ESPIPE, or EINVAL on failure. (4.9.10.4) The messages generated by the perror function:
These messages, or their translation into the language of the locale of the LC_MESSAGE category, are generated.
Memory
(4.10.3) The behavior of the calloc, malloc, or realloc function if the size requested is zero:
malloc and calloc return a unique pointer if the size is zero. realloc frees the object pointed to if the size is zero, and the pointer is not null.
abort Function
(4.10.4.1) The behavior of the abort function with regard to open and temporary files:
abort first closes all open files, stdio streams, directory streams, and message catalogue descriptors, if possible, and then sends the signal SIGABRT to the calling process.
exit Function
(4.10.4.3) The status returned by the exit function if the value of the argument is other than zero, EXIT_SUCCESS, or EXIT_FAILURE:
The value returned by the argument to exit.
getenv Function
(4.10.4.4) The set of environment names and the method for altering the environment list used by the getenv function:
The set of environment names provided to a program are the same as those that were in the environment when the program was executed. Any environment variable altered during program execution does not permanently change the environment variable; that is, the environment variable has the same value upon program completion as it did before the program was executed.
system Function
(4.10.4.5) The contents and mode of execution of the string by the system function:
(void) execl("/sbin/sh", "sh", (const char *)"-c", string, (char
*)0);
strerror Function
(4.11.6.2) The contents of the error message strings returned by the strerror function:
See 4.9.10.4.
Locale Behavior
(4.12.1) The local time zone and Daylight Savings Time:
The local time zone is set by the environment variable TZ. (4.12.2.1) The era for the clock function
The era for the clock is represented as clock ticks with the origin at the beginning of the execution of the program. (2.2.1) The content of the execution character set, in addition to the required members:
Locale-specific (no extension in C locale). (2.2.2) The direction of printing:
Printing is always left to right. (4.1.1) The decimal-point character:
Locale-specific ("." in C locale). (4.3) The implementation-defined aspects of character testing and case mapping functions:
Same as 4.3.1. (4.11.4.4) The collation sequence of the execution character set:
Locale-specific (ASCII collation in C locale). (4.12.3.5) The formats for time and date:
Locale-specific. Formats for the C locale are shown in the tables below.
January |
May |
September |
February |
June |
October |
March |
July |
November |
April |
August |
December |
The names of the months are:
The names of the days of the week are:
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
The formats for AM and PM designation are: AM PM