C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
SHARED
The pragma default settings are:
SYSTYPE OSSSYSTYPE GUARDIAN
N.A.N.A.TNS C compiler
N.A.N.A.G-series TNS c89 utility
NON_SHAREDNON_SHAREDTNS/R native C and C++ compilers
TNS/R code: NON_SHAREDTNS/E
code: CALL_SHARED
TNS/R code: NON_SHAREDTNS/E
code: CALL_SHARED
Native c89 and c99 utilities
CALL_SHAREDCALL_SHAREDTNS/E native C and C++ compilers
Usage Guidelines
• On Guardian environment, the SHARED pragma can appear only on the RUN command line
for CCOMP, CPPCOMP, NMC, or NMCPLUS. On OSS environment, the -Wshared option
can appear only on the command line for the c89 or the c99 utility.
• The default behavior of SHARED is to invoke the eld or ld linker and to produce a PIC library
file (a DLL).
◦ On Guardian environment, if you specify both SHARED and RUNNABLE, the compiler
issues an error and terminates.
◦ On OSS environment, if you specify both -c and -Wshared, the compiler issues an error
and terminates.
• If you specify CPPONLY or SYNTAX with the SHARED pragma, linking does not occur because
it is prevented by the additional pragmas.
• For complete information about programming with DLLs and linker options for DLLS, see the:
DLL Programmer’s Guide for TNS/R Systems◦
◦ DLL Programmer’s Guide for TNS/E Systems
◦ eld Manual
◦ ld Manual
◦ rld Manual
• The SHARED pragma cannot be used with the CALL_SHARED, SRL or NON_SHARED pragmas.
A warning is issued if these pragmas are combined.
• EXTERN_DATA gp_ok is not compatible with generation of shared code. The compiler issues
a warning if this pragma is combined with the SHARED pragma or CALL_SHARED, and ignores
the gp_ok directive.
SQL
The SQL pragma enables the compiler to process subsequent SQL statements. Embedded SQL/MP
statements can be placed in C code but not in C++ code.
SQL [ sql-option | ( sql-option [ , sql-option ]... ) ]
sql-option:
{ [NO]WHENEVERLIST )
238 Compiler Pragmas