C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

the ISO/ANSI C standard and results in code that is not portable. The current TNS compiler
does not generate these function prototypes for you.
Change code that is affected by the behavioral changes of the sscanf(), fflush(), or
fcntl() functions:
For C-series compilers, sscanf() returns a -1 if no conversion takes place. For the current
compilers, sscanf() returns a 0 if no conversion takes place.
For C-series compilers, the fflush() function can flush partial lines if standard output
(stdout) and standard error (stderr) are directed to type 101 EDIT files. For the
current compilers, the fflush() function does not flush partial lines if stdout and
stderr are directed to type 101 EDIT files because these files are shared resources
under the CRE.
For the current compilers, to flush partial lines to the stdout and stderr files, you must
either open the files using freopen() or close and reopen the files using fopen(). In
both cases, these files cannot be shared.
For C-series compilers, the fcntl() function with the F_GETDTYPE parameter returns
the device type of the file in bits 4 through 9 of the value returned. It also returns additional
information from the Guardian procedure DEVICEINFO in other bits of the returned value.
For the current compilers, the fcntl() function returns only the device type information
in the value returned. Instead of calling Guardian procedure DEVICEINFO, fcntl()
calls the Guardian procedure FILE_GETINFO_.
Change macros to use a # directive to replace parameters inside a literal string.
For C-series compilers, if a function-like macro has a literal string in its substitution list, the
compiler treats the literal string as a series of tokens. The compiler searches the literal string
for a token matching the macro parameter list. If the compiler finds a match, it performs the
substitution.
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 this 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 these 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
these statements:
150 Converting C-Series TNS Programs to Use the Current TNS Compiler