C/C++ Programmer's Guide (G06.25+)
Converting C-Series TNS Programs to Use the
Current TNS Compiler
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
10-3
For the current compilers, the compiler treats a literal string as a preprocessor
token of the substitution list. The literal string is not scanned.
For example, you must change the following C-series macro to use the # directive:
C-series macro:
#define pr (x, format) printf("The x = %format\n"), (x))
D-series macro:
#define str(a) # a
#define pr(x, format) printf(str(The x = %format\n), (x))
•
Recode your programs to eliminate the use of the following HP C supplementary
library calls that are not supported by the current compilers:
°
extfname_to_intfname()
This function is not required because the D-series Guardian system
procedures accept and return external file names.
°
lastreceive() and receiveinfo()
Call the Guardian procedure FILE_GETRECEIVEINFO_ instead.
•
Before the D-series releases, you had to bind the memory-model independent C
run-time library (CLIB) into your TNS application code. On current systems, CLIB
and the Common Run-Time Environment library (CRELIB) are configured as part
of the system library. (These run-time library routines have already been
accelerated for native systems.) Do not bind CLIB or CRELIB into current
programs. Check any Binder scripts for C-series compilations and remove any of
the following statements:
SELECT SEARCH clib
ADD * FROM clib
The following additional changes were made to HP C for the D-series releases. It is
highly unlikely that you must change your programs because of these changes:
•
The definition of the object-like macro NULL was removed from the C header files
asserth, ctypeh, errnoh, floath, limitsh, mathh, and setjmph. These
header files now conform to the ISO/ANSI C standard.
•
The number of parameters allowed for a nonextensible and nonvariable functions
increased from 200 to 252. The compiler issues an error if a function exceeds this
limit.
•
The default number of secondary extents for files created by the Guardian C
fopen() and creat() functions increased from 4 to 16.
•
The default number of maxextents for files created by the Guardian C fopen()
and creat() functions increased from 16 to 500.
•
Starting with the D20.00 RVU, the C run-time library uses Greenwich Mean Time
(GMT) for the date January 1, 1970. In previous releases, the C run-time library
used Pacific standard time (PST), which is eight hours ahead of GMT. The