cmoc (cmoc 0.1.101)
Copyright (C) 2003-2023 Pierre Sarrazin
This program is free software; you may redistribute it under the terms of
the GNU General Public License, either version 3 or later.
This program comes with absolutely no warranty.
--help|-h Display this help page and exit.
--version|-v Display this program's version number and exit.
--verbose|-V Display more informationg about the compiling process.
--preproc|-E Copy preprocessor output to standard output (or to a file specified
with -o), instead of compiling.
-S Stop after generating an assembly language file.
--compile|-c Stop after generating an object file.
-o FILE Place the output in FILE (default: change C file extension to .bin).
--deps[=F] Create a .d file containing a makefile rule giving the dependencies
of the compiled file. If a filename (F) is given, it is used instead
of forming the dependency filename from the code output filename.
--deps-only[=F] Same, but do nothing else and stop.
-O0|-O1|-O2 Optimization level (default is 2). Compilation is faster with -O0.
-funsigned-char Assume that `char' is unsigned by default.
-fsigned-char Assume that `char' is signed by default. (This is the default.)
-fomit-frame-pointer Do not keep the frame pointer in a register for functions that do not
need one. Experimental. Use with caution.
--org=X Use X (in hex) as the first address at which to generate
the code; default: 2800.
--limit=X Fail if program_end exceeds address X (in hex).
--data=X Use X (in hex) as the first address at which to generate the
writable global variable space; by default that space follows
the code.
--coco Compile for the CoCo Disk Basic environment (default).
--decb Synonym for --coco.
--dos Compile to a CoCo Disk Basic track 34 boot loader (implies --coco).
Must be passed when compiling the .c file containing main().
--dragon Compile for the Dragon environment.
--thommo Compile for the Thomson MO.
--thomto Compile for the Thomson TO.
--os9 Compile for OS-9.
--flex Compile for FLEX.
--vectrex Compile for the Vectrex video game console.
--void-target Compile for a target that has no I/O system known to CMOC.
--usim Compile for the USIM 6809 simulator.
--srec Executable in Motorola SREC format.
--raw Executable in raw format (passes --format=raw to lwlink)
--cpp=X Use X as the path to the C preprocessor (default: cpp).
--lwasm=X Use X as the path to the LWTOOLS assembler.
--lwasm-pragma=X Pass X to --pragma when invoking lwasm. Default: forwardrefmax
X must be a comma-separated list of terms accepted by lwasm --pragma.
--lwlink=X Use X as the path to the LWTOOLS linker.
-Idir Add directory
to the compiler's include directories
(also applies to assembler).
-Dxxx=yyy Equivalent to #define xxx yyy
-L dir Add a directory to the library search path.
-l name Add a library to the linking phase. -lfoo expects `libfoo.a'.
This option must be specified after the source/object files.
-nodefaultlibs Excludes CMOC-provided libraries from the linking phase.
--no-relocate Assume that the program will only be loaded at the addresses specified
by --org and --data. Not compatible with OS-9. Default for Vectrex.
--check-null Insert run-time checks for null pointers. See the manual.
--check-stack Insert run-time checks for stack overflow. See the manual.
Not usable under OS-9, where stack checking is automatic.
--stack-space=N Assume the stack may use as many as N bytes (in decimal).
Affects --check-stack and sbrk().
Must be used when compiling the main() function.
Not usable under OS-9, where stack checking is automatic.
Ignored when targeting Vectrex.
--add-os9-stack-space=N
(OS-9 only.) Allocate N more bytes (in decimal) to the stack space
that OS-9 normally reserves.
--function-stack=N (OS-9 only.) Emit code at the start of each function to check that there
is at least N bytes (in decimal) of free stack space in addition to
local variables. 0 means no stack checking. Default is 64.
--initial-s=X Generate an immediate-mode LDS instruction as the first instruction
of the executable. Use X (in hex) as the argument.
Not compatible with --os9.
-Wsign-compare Warn when <, <=, >, >= used on operands of differing signedness.
-Wno-const Do not warn about const-incorrect code.
-Wgives-byte Warn about binary operations on bytes giving a byte.
-Wlocal-var-hiding Warn when a local variable hides another one.
-Wshadow Equivalent to -Wlocal-var-hiding.
-Wno-printf Do not warn when printf/sprintf format is not a string literal.
-Wno-uncalled-static Do not warn when a static function is not called.
-Wfor-condition-sizes
Warn if a for() loop's condition compares values of different sizes.
Ex.: unsigned n = 256; for (unsigned char i = 0; i < n; ++i) {...}
-Wno-missing-field-initializers
Do no warn when a struct is initialized with fewer values than
there are fields.
-Wno-inline-asm-array-indexes
Do not warn when an inline assembly statement uses an array index in
a C array variable reference. Such an index is taken as an element index,
not a byte index. (An index into a non-array is a byte index.)
-Wno-unknown-first-dim
Do not warn about arrays whose first dimension has an unknown size,
e.g., int a[] = { ... };
-Wno-array-size-zero Do not warn when an array has size zero.
-Wno-too-many-elements
Do not warn about array initializers having more elements than the array
they initialize, e.g., int a[] = { 1, 2, 3 };
-Wno-shift-always-zero
Do not warn about bit shifts that always gives a zero.
-Wno-label-on-declaration
Do not warn when a label is put on a declaration.
-Wno-assign-in-condition
Do not issue a warning when an assignment is used as a condition
in an if(), while() or do-while() statement.
-Waccept-word-sized-return-type-mismatch
Issue a warning instead of an error when the argument of a return
statement mismatches the return type of a function, and both types
are words, pointers or arrays. (Helps tolerate K&R code.)
-Wno-non-void-function-without-return
Do not warn about non-void functions that have no return statement.
-Wno-return-without-argument-in-non-void-function
Do not warn about a return without an argument in a non-void function.
-Wno-calling-undeclared-function
Do not warn about calling a function that has not been declared or defined.
-Wno-builtin-macro-redefined
Do not warn when a builtin macro gets redefined.
Useful to suppress warnings about `__cplusplus' macro.
-Werror Treat warnings as errors.
-w Inhibit all warning messages.
--switch=MODE Force all switch() statements to use MODE, where MODE is 'ifelse'
for an if-else sequence or 'jump' for a jump table.
--intermediate|-i Keep intermediate compilation and linking files.
--intdir=D Put intermediate files in directory D.
-x c Assume that files other than .s, .asm, .o and .a are C files.
-x none Only consider .c files as C files.
Executable file formats:
CoCo BIN for CoCo Disk Basic, Dragon, Thomson MO/TO; raw binary for Vectrex;
SREC for FLEX, void-target and USIM; OS-9 for OS-9.
Can be overridden by --srec or --raw, except for OS-9.
Preprocessor identifer _CMOC_VERSION_ is defined as: 1101
Compiler data directory: /tmp/vcc-cmoc.RErUziuv/cmoc
Compiler floating-point library directory: /tmp/vcc-cmoc.RErUziuv/cmoc/lib
For details, see the manual on the CMOC home page.