COMMAND - command to compile C source files.

Syntax:

c [sourcefile] [option]*
(+|-)18bitShorts (-)   (+|-)Batch (-)
(+|-)Clear (-)         (+|-)ControlComments (-)
(+|-)Go (-)            (+|-)Keep (-)
(+|-)Load (+)          (+|-)LoadBstar (-)
(+|-)Map (-)           +MiXed
(+|-)Tables (+)        Configuration=filename
CPPOpts=options        Define=macro
Hstar=filename         Include=prefix
LiSting=keywords       Library=library
Memory=size            Name=module
Stack=nn               StandardInclude=prefix
StandardLibrary=lib    USe=name,name,...
Updatelib=library

Examples:

c /myfile Hstar=/prog Stack=1000

Options:

sourcefile
is a file containing C source code. If this is omitted, no source is compiled, but the user must supply either the +LoadBstar option or at least one input library.
+18bitShorts
indicates that the "short" and "unsigned short" types should be stored in 18 bits rather than 36. Note that the library is compiled with -18bitShorts. The only place where this causes problems is with the "scanf" family of functions. If you use "scanf" to read a "short" value, you MUST read it into a 36-bit machine word, even if you have +18bitShorts in effect.
+Batch
indicates that the resulting Hstar file is to run in batch, rather than TSS. The compiler will use the standard "batch" run-time library instead of "tss".
+Clear
is used in conjunction with Update= to indicate that the library should be cleared. This is needed if you are creating a new library, or if you want to delete everything from an existing library.
+ControlComments
requests the compiler to interpret LINT control comments. These comments are normally ignored, but their effect may be accomplished using the corresponding pragma.
+Go
executes the program once it has been successfully compiled and linked. By default, the program will be compiled and linked but not executed.
+Keep
leaves the intermediate files in the AFT.
-Load
indicates that no linking should occur. The object module is left in the file "b*".
+LoadBstar
relinks an object file saved from a previous compile/load. This is useful if a library was omitted on the previous compile.
+Map
displays the load map on the terminal.
+MiXed
indicates that the resulting Hstar file is to run either in batch or in TSS. The compiler generates both a batch and a TSS version in the same file. Any name supplied with the Name= option is applied to the batch module only. This option makes the hstar file twice its normal size, and if the +Map option is used, two load maps will be produced.
-Tables
prevents the generation of local symbol tables for line numbers and auto variables.
Configuration=filename
specifies that the named file should be used by the preprocessor to define macros and to map include file names.
Define=macro
 
Define=macro=value
causes the given macro to be defined by the preprocessor. If no value is given, the macro will have a null value.
CPPOpts=string
passes the given string to the preprocessor. This was primarily used for defining macros on the command line. The Define= and Configuration= options should now be used instead.
Hstar=filename
places the compiled program in the given file.
Include=prefix
searches the catalog or subcatalog "prefix" for quoted #include files (if necessary). If multiple subcatalogs are specified, they will be searched in the order specified on the command line.
Library=name
indicates a library to be used when linking the program.
LiSting=keywords
specifies which parts of a listing should be produced. The keywords should be selected from abbreviations of the following, separated by commas (or placed in multiple LiSting= options):
Inputsource  - List the source and include files
Outputsource - List the output of the preprocessor
Xref         - List an identifier cross reference
Assembler    - List the generated machine code

The listing is written to standard output. If no keywords are supplied (that is, the option is just LiSting=), a listing is generated which contains all of the above sections.

Memory=nn
allocates "nn" K words for the loader. The loader allocates memory as needed so this option is needed only when bugs are found in the loader's grow code.
Name=module
gives the Hstar element the name "module".
Stack=nn
dictates the size of the stack to be used when the program is run. Size is given as a number of machine words.
StandardInclude=prefix
searches the catalog or subcatalog "prefix" for #include files enclosed in angle brackets ('<' and '>'). If multiple subcatalogs are specified, they will be searched in the order specified on the command line.
StandardLibrary=name
indicates the name of a system library to be searched. See the "Standard Libraries" section below for a list of recognized "names".
Update=name
indicates a random library into which the object file from this compilation should be edited.
USe=name,name,...
forces the loader to load the routine(s) identified by the given name(s). The names must be six characters or less in length. This feature is implemented by having the compiler generate SYMREF's to the named routines.

Description:

This command compiles C programs for execution in accommodation mode (single segment) under GCOS-8. Options that imply calling the loader or the library editor are illegal when the compiler is running in batch.

By default, the compiler generates tables describing local variables and source code line numbers, which are interpreted by the BOFF debugger. The tables for variables are somewhat rudimentary for C, since they contain neither type nor scope information. These tables can be omitted by using the -Tables option when the module is compiled; this will reduce program size. In addition, if the program is being loaded by the compiler, the -Tables option will turn off stack bounds checking.

To obtain a listing of the generated code, the BST command should be used to dump the contents of the object file.

Diagnostics:

This compiler gives more warning messages than many other versions of C. Programmers may want to suppress some of these warnings, when the code in question is known to be correct. The LINT Manual ("expl lint manual") explains how this can be done in various circumstances.

Include File Search Rules:

For #include directives which contain a name enclosed in quotes, the compiler first looks for a mapping for that name in any of the configuration files. (Configuration files are explained in "expl c cpp".) If no such mapping is found, the compiler searches for a file whose name matches the one in quotes. The search process follows these steps:

  1. First, the compiler searches the catalog that contained the source file being compiled. If you #include file A which in turn #includes file B, the search for B will begin in the catalog that contains A, not in the catalog that contains the original source file.
  2. Next the compiler searches each directory named in an Include= option, in the order that the options were given on the command line.
  3. Next the compiler searches the following catalogs (called the standard include catalogs):
    c_g8_ss/8cl3.3/include/site
    c_g8_ss/8cl3.3/include
  4. Finally, the compiler tries the name as specified inside the quotes.

For #include directives that enclose the name in angle brackets, the search again starts with mappings from the configuration files. After that, the search follows these steps:

  1. The compiler searches catalogs named with StandardInclude= options on the command line, in the order they are given on the command line.
  2. Next the compiler searches the two standard include catalogs (mentioned previously).
  3. Finally, the compiler searches for the file name given inside the angle brackets.

Thus if you want your code to include a file whose name matches one that is supplied with this release (or by the site), you can use the quoted form of #include, or use the angle bracket form and specify the appropriate catalog using the StandardInclude= option. Note that if you try to include a file whose name conflicts with one of the standard headers defined by the ANSI C standard, the resulting behavior may be undefined.

Standard Libraries:

The StandardLibrary=name option accepts the following values for "name":

alias
The ANSI standard states that you can declare <math.h> functions yourself rather than using
#include <math.h>

However, if you do not #include <math.h>, you may get a Fortran version of routines like "sin" and "cos", instead of the C version. Putting StandardLibrary=alias on the command line ensures that you get the correct C version.

batch
This picks up the batch version of the standard C library (for preparing programs that run in batch). You do not have to specify StandardLibrary=batch if you specify +Batch.
syslib
This is just a version of the system library for the most recent release of the UW Tools package.
tss
This picks up the TSS version of the standard C library (for preparing programs that run under TSS). It is the default and does not have to be specified.
ufas
This picks up versions of the UFAS library routines.

See Also:

expl c batch
for compiling source files in batch.
expl c lib
for information about the run-time package and other standard libraries.
expl c cpp
for information about preprocessing facilities and configuration files.
expl bst
for information on the object file disassembler.
expl boff
for information about the debugger.
expl c manifests
for more information on target systems.
expl lint manual
for checking validity and portability of C programs.
expl go
command for executing C programs.

Files Used:

fc**2, fc**3, fc*bw - work files
b* - object file output
c_g8_ss/8cl3.3/include - catalog of standard includes
c_g8_ss/8cl3.3/include/site - site specific includes
c_g8_ss/8cl3.3 - catalog of standard libraries

Copyright © 1996, Bull HN and Thinkage Ltd.