HC(1) —
NAME
hc − Optimizing High C compiler
SYNOPSIS
hc [ options ] file ...
DESCRIPTION
The hc command invokes version 2 of the High C compiler. The compiler accepts C-language programs at the draft ANSI Standard C level and compiles with or without global optimization. The command accepts several types of arguments:
• Arguments with filenames ending in “.c” are taken to be C source programs. They are preprocessed either by cpp or the inboard preprocessor, compiled to assembler source, and assembled as(1) to produce object files with the same names ending in “.o” instead of “.c”. The “.o” file is normally deleted if a single C program is compiled and loaded at one time.
• In the same way, arguments with names ending in “.s” are taken to be assembly source programs and are assembled, producing “.o” files.
Unless the loading is suppressed by the −c option, all produced “.o” and argument “.o” files are linked ld(1) with standard startoff and library routines to produce an executable module named a.out.
Arguments that begin with “-” are options that modify the behavior of hc(1), the cpp preprocessor, as(1), or ld(1). The following options are interpreted by hc. See ld(1) for load-time options. By convention, options applicable only to the High C compiler are prefixed with an H. The −Hxxxx options are described in detail in the “High C Programmer’s Guide.” The most frequently used −Hxxxx options are included in the following list.
−c Suppress the loading phase of the compilation, and force an object (.o) file to be produced even if only one program is compiled.
−g Have the compiler produce additional symbol-table information for dbx(1). This flag turns off certain optimizations that complicate debugging by rearranging code. Use the −O flag in conjunction with −g if you wish all normal optimizations to be included.
−w Suppress warning diagnostics.
−p Arrange for the compiler to produce code that counts the number of times each routine is called during execution. If loading takes place, search the profiling library /usr/lib/libc_p.a in lieu of the standard C library /lib/libc.a. Also replace the standard startup routine by one that automatically calls monitor(3) at the start and arranges to write out a mon.out file at normal termination of execution of the object program. An execution profile can then be generated by use of prof(1).
−pg Like −p, but invoke a run-time recording mechanism that keeps more extensive statistics and produces a gmon.out file at normal termination. An execution profile can then be generated by use of gprof(1).
−O Perform all optimizations supported by the compiler. Many optimizations are performed even without the −O option.
−R Pass this flag on to as, making initialized variables shared and read-only.
−S Suppress assembly and loading. Produces a “.s” file for each “.c” file argument. The −Hanno option annotates the “.s” file.
−M Run only the cpp macro preprocessor on the named C programs, requesting it to generate Makefile dependencies and send the result to the standard output.
−E Run only the cpp macro preprocessor on the named C programs, and send the result to the standard output.
−C Prevent the cpp macro preprocessor from removing comments.
−o output Name the final output file output. If this option is used, the file a.out will be left undisturbed.
−Dname=def
−Dname Define name to the preprocessor, as if by “#define”. If no definition is given, name is defined as 1 (one).
−Uname Remove any initial definition of name.
−Idir “#include” files that do not have names beginning in “/” are always sought first in the directory of the file argument, then in directories named in −I options, and finally in directories on a standard list.
−Ldir Library archives are sought first in directories named in −L options, then in directories on a standard list.
−Bstring Find substitute compiler executables in the files named string with the suffixes “hc1com” and “hc2com.”
−v Display each subprocess being executed on standard error.
−mx Compile using some machine-dependent options. The available options are:
−ma Support use of alloca(3) by the compiled function. Alloca places some constraints on compiled code, making it slightly less efficient. Only the individual functions that call alloca need be compiled with −ma.
−ms Forces the compiler to put out minimum-size floating point data blocks. (Normally they are generously padded.) This guarantees that the size of objects will remain approximate to that of previous releases, at a small cost in performance. See the “IBM/4.3 Linkage Convention” article for more information.
−Hanno
Annotate the generated “.s” file with comment lines containing the source code from the “.c” file.
−Hansi
Causes the compiler to only accept programs conforming to the proposed ANSI standard.
−Hcpp
Invoke the cpp macro preprocessor on all source files before compiling. This is the default.
−Hnocpp
Use the hc ANSI-conforming macro preprocessor instead of cpp.
−Hlist
Produce a source listing on standard output.
−Hon=toggle
−Hoff=toggle
Turn toggle on or off. (See Compiler Toggles in the “High C Programmer’s Guide” for a description of the compiler toggles.)
−Hpcc
Specifies that the compiler is to run in “PCC” mode. In “PCC” mode the compiler relaxes enough of the ANSI extensions to more or less emulate the Portable C Compiler. This permits old C programs that would not ordinarily compile to compile with few (if any) modifications. See the “High C Programmer’s Guide” for details.
−Hvolatile
Inhibit optimization of pointer dereferencing, forcing each instance to generate a memory access. Consider this a conversion aid to be used until truly volatile objects have been identified and labeled with the volatile type qualifier.
−H+w
Issue all warnings. The default is to suppress low-severity warnings.
FILES
file.cC source file
file.oobject file
file.sassembler source file
a.outloaded output
/tmp/pp.∗temporary
/lib/cppoutboard macro preprocessor
/usr/lib/hc1comcompiler pass 1
/usr/lib/hc2comcompiler pass 2
/lib/crt0.oruntime startoff
/lib/mcrt0.ostartoff for profiling
/usr/lib/gcrt0.ostartoff for gprof-profiling
/lib/libc.astandard library, see intro(3)
/usr/lib/libc_p.aprofiling library, see intro(3)
/usr/includedirectory for #include files
mon.outfile produced for analysis by prof(1)
gmon.outfile produced for analysis by gprof(1)
SEE ALSO
B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice-Hall, 1978
B. W. Kernighan, Programming in C—a tutorial
D. M. Ritchie, C Reference Manual
“IBM/4.3 Linkage Convention” in the supplementary documents
“High C Programmer’s Guide” in Appendix C
High C Language Extensions Manual with Rationale and Tutorials, from MetaWare Incorporated.
“Recompiling with High C” in the supplementary documents
adb(1), as(1), cc(1), dbx(1), gprof(1), ld(1), pcc(1), prof(1), malloc(3), monitor(3)
PRPQs 5799-WZQ/5799-PFF: IBM/4.3 — Sept 1988