Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

c89(1) OSS Shell and Utilities Reference Manual
7. The command
c89 -Wsql=release2,sqlmap -c file.c
compiles file.c with NonStop SQL/MP support enabled. The listing includes an SQL
map. The NonStop SQL/MP processor is run, expecting NonStop SQL/MP release 2
features. The NonStop SQL/MP compiler is not run. A -Wsqlcomp flag would run the
NonStop SQL/MP compiler. Note that there is no white space after the comma in the
-Wsql flag.
8. The command
c89 -Wsqlmx -Wmxcmp -o sqlprog.exe sqlprog.ec
causes the following steps to be performed:
a. c89 invokes the NonStop SQL/MX preprocessor, mxsqlc. mxsqlc takes the file
sqlprog.ec (consisting of a single C module with embedded NonStop SQL/MX
information) as input and produces two files: sqlprog.c and sqlprog.m.
sqlprog.c is the C-only equivalent of sqlprog.ec; that is, NonStop SQL/MX
statements are translated to the appropriate C code. sqlprog.m is the
corresponding MDF.
b. If there are no errors in Step a, c89 invokes the C compiler to compile sqlprog.c,
creating the object file sqlprog.o.
c. If there are no errors in Step b, c89 invokes the NonStop SQL/MX compiler to
process the MDF file sqlprog.m.
d. If there are no errors in Step c, c89 invokes nld to link sqlprog.o with the C stan-
dard library and produce the executable file sqlprog.exe.
9. The command
c89 -c -Wsqlmx file1.eC file2.ecc file3.ec++
uses the mxsqlc preprocessor on several C++ source files and also compiles them, but
does not link the results. If no errors are detected in either the preprocessing or compila-
tion steps, the following files are created: file1.m, le1.C, file2.m, file2.cc, file3.m,
file3.c++, file1.o, file2.o, le3.o.
10. The command
c89 -Wsqlmx -E file.ec > file-cpp.c
uses the mxsqlc preprocessor to expand embedded SQL statements and invokes the Non-
Stop SQL/MX preprocessor to create a single source file containing only C statements.
11. The command
c89 -c -Wsqlmx file1.C file2.ecc file3.ec++ file4.cpp
illustrates mixing C++ source files, with and without NonStop SQL/MX information, on
a single command line. Only source files that have names with one of the SQL extension
sufxes invoke the mxsqlc preprocessor. However, all files are compiled but not linked.
If no errors are detected in either the preprocessing or compilation steps, the following
files are created: file2.m, le2.cc, file3.m, file3.c++, le1.o, file2.o, le3.o, file4.o.
232 Hewlett-Packard Company 527188-021