This appendix describes the behavior of the 16-bit and 32-bit Watcom C library when the ANSI/ISO C Language standard describes the behavior as implementation-defined. The term describing each behavior is taken directly from the ANSI/ISO C Language standard. The numbers in parentheses at the end of each term refer to the section of the standard that discusses the behavior.
ANSI/ISO: "The null pointer constant to which the macro NULL expands (7.1.6)."
The macro NULL expands to 0 in small data models, and to 0L in large data models.
ANSI/ISO: "The diagnostic printed by and the termination behavior of the assert() function (7.2)."
The assert() function prints a diagnostic message to stderr, and calls the abort() routine if the expression is false. The diagnostic message has the following form:
Assertion failed: [expression], file [name], line [number]
ANSI/ISO: " The sets of characters tested for by the isalnum(), isalpha(), iscntrl(), islower(), isprint() and isupper() functions (7.3.1)."
The characters tested are as follows:
ANSI/ISO: "The values returned by the mathematics functions on domain errors (7.5.1)."
When a domain error occurs, the listed values are returned by the following functions:
ANSI/ISO: "Whether the mathematics functions set the integer expression errno to the value of the macro ERANGE on underflow range errors (7.5.1)."
The integer expression errno isn't set to ERANGE on underflow range errors in the mathematics functions.
ANSI/ISO: "Whether a domain error occurs or zero is returned when the fmod() function has a second argument of zero (22.214.171.124)."
Zero is returned when the second argument to fmod() is zero.
ANSI/ISO: "The set of signals for the signal() function (126.96.36.199)."
ANSI/ISO: "The semantics for each signal recognized by the signal() function (188.8.131.52)."
ANSI/ISO: "The default handling and the handling at program startup for each signal recognized by the signal() function (184.108.40.206)."
See the description of the signal() function presented earlier in this reference. Also see the QNX System Architecture manual.
ANSI/ISO: "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 (220.127.116.11)."
The equivalent of
signal( sig, SIG_DFL );
is executed prior to the call of a signal handler.
ANSI/ISO: "Whether the default handling is reset if the SIGILL signal is received by a handler specified to the signal() function (18.104.22.168)."
The equivalent of
signal( SIGILL, SIG_DFL );
is executed prior to the call of the signal handler.
ANSI/ISO: "Whether the last line of a text stream requires a terminating newline character (7.9.2)."
The last line of a text stream doesn't require a terminating newline character.
ANSI/ISO: "Whether space characters that are written out to a text stream immediately before a newline character appear when read in (7.9.2)."
All characters written out to a text stream will appear when read in.
ANSI/ISO: "The number of null characters that may be appended to data written to a binary stream (7.9.2)."
No null characters are appended to data written to a binary stream.
ANSI/ISO: "Whether the file position indicator of an append mode stream is initially positioned at the beginning or end of the file (7.9.3)."
When a file is open in append mode, the file position indicator initially points to the end of the file.
ANSI/ISO: "Whether a write on a text stream causes the associated file to be truncated beyond that point (7.9.3)."
Writing to a text stream doesn't truncate the file beyond that point.
ANSI/ISO: "The characteristics of file buffering (7.9.3)."
Disk files accessed through the standard I/O functions are fully buffered. The default buffer size is 1024 bytes.
ANSI/ISO: "Whether a zero-length file actually exists (7.9.3)."
A file with length zero can exist.
ANSI/ISO: "The rules of composing valid file names (7.9.3)."
A valid file specification consists of an optional node name (which is always preceded by two slashes), a series of optional directory names (each preceded by one slash), and a file name. If a node name or directory name precedes the file name, the file name must also be preceded by a slash.
Directory names and file names can contain up to 48 characters. Case is respected.
ANSI/ISO: "Whether the same file can be open multiple times (7.9.3)."
It is possible to open a file multiple times.
ANSI/ISO: "The effect of the remove() function on an open file (22.214.171.124)."
The remove() function deletes a file, even if the file is open.
ANSI/ISO: "The effect if a file with the new name exists prior to a call to the rename() function (126.96.36.199)."
The rename() function succeeds if you attempt to rename a file using a name that exists.
ANSI/ISO: "The output for %p conversion in the fprintf() function (188.8.131.52)."
Two types of pointers are supported: near pointers (%hp), and far pointers (%lp). The output for %p depends on the memory model being used.
In 16-bit mode, the fprintf() function produces hexadecimal values of the form XXXX for 16-bit near pointers, and XXXX:XXXX (segment and offset separated by a colon) for 32-bit far pointers.
In 32-bit mode, the fprintf() function produces hexadecimal values of the form XXXXXXXX for 32-bit near pointers, and XXXX:XXXXXXXX (segment and offset separated by a colon) for 48-bit far pointers.
ANSI/ISO: "The input for %p conversion in the fscanf() function (184.108.40.206)."
The fscanf() function converts hexadecimal values into the correct address when the %p format specifier is used.
ANSI/ISO: "The interpretation of a - character that is neither the first nor the last character in the scanlist for %[ conversion in the fscanf() function (220.127.116.11)."
The "-" character indicates a character range. The character prior to the "-" is the first character in the range. The character following the "-" is the last character in the range.
ANSI/ISO: "The value to which the macro errno is set by the fgetpos() or ftell() function on failure (18.104.22.168, 22.214.171.124)."
When the functions fgetpos() and ftell() fail, they set errno to EBADF if the file number is bad. The constants are defined in the <errno.h> header file.
ANSI/ISO: "The messages generated by the perror() function (126.96.36.199)."
The perror() function generates the following messages:
ANSI/ISO: "The behavior of the calloc(), malloc() or realloc() function if the size requested is zero (7.10.3)."
The value returned is NULL. No actual memory is allocated.
ANSI/ISO: "The behavior of the abort() function with regard to open and temporary files (188.8.131.52)."
The abort() function doesn't close any files that are open or temporary, nor does it flush any output buffers.
ANSI/ISO: "The status returned by the exit() function if the value of the argument is other than zero, EXIT_SUCCESS, or EXIT_FAILURE (184.108.40.206)."
The exit() function returns the value of its argument to the operating system, regardless of its value.
ANSI/ISO: "The set of environment names and the method for altering the environment list used by the getenv() function (220.127.116.11)."
The set of environment names is unlimited. Environment variables can be set from the QNX command line using the export or set shell commands, or the env utility. A program can modify its environment variables with the putenv() function. Such modifications last only until the program terminates.
ANSI/ISO: "The contents and mode of execution of the string by the system() function (18.104.22.168)."
The system() function always executes an executable binary or a shell file, using /bin/sh.
ANSI/ISO: "The contents of the error message strings returned by the strerror() function (22.214.171.124)."
The strerror() function generates the following messages:
ANSI/ISO: "The local time zone and Daylight Saving Time (7.12.1)."
The time zone is set in the system initialization file for your node (for example, /etc/config/sysinit.2). See the QNX User's Guide.
ANSI/ISO: "The era for the clock() function (126.96.36.199)."
The clock() function's era begins with a value of 0 when the program starts to execute.