Next: 3.2.10 Intermediate Dump Options
Up: 3.2 Command Line Options
Previous: 3.2.8 Optimization Options
Contents
Index
3.2.9 Other Options
- [-c --compile-only] will
compile and assemble the source, but will not call the linkage editor.
- [--c1mode] reads the preprocessed
source from standard input and compiles it. The file name for the
assembler output must be specified using the -o option.
- [-E] Run only the C preprocessor. Preprocess
all the C source files specified and output the results to standard
output.
- [-o <path/file>] The output path
where everything will be placed or the file name used for all generated
output files. If the parameter is a path, it must have a trailing
slash (or backslash for the Windows binaries) to be recognized as
a path. Note for Windows users: if the path contains spaces,
it should be surrounded by quotes. The trailing backslash should be
doubled in order to prevent escaping the final quote, for example:
-o ''F:\Projects\test3\output
1\\'' or put after the final quote,
for example: -o ''F:\Projects\test3\output
1''\. The path using slashes for directory delimiters
can be used too, for example: -o ''F:/Projects/test3/output
1/''.
- [--stack-auto] All functions
in the source file will be compiled as reentrant,
i.e. the parameters and local variables will be allocated on the stack.
See section 3.7 Parameters and
Local Variables for more details. If this option is used all source
files in the project should be compiled with this option. It automatically
implies --int-long-reent and --float-reent.
- [--callee-saves] function1[,function2][,function3]....
The compiler by default uses a caller saves convention for register
saving across function calls, however this can cause unnecessary register
pushing and popping when calling small functions from larger functions.
This option can be used to switch the register saving convention for
the function names specified. The compiler will not save registers
when calling these functions, no extra code will be generated at the
entry and exit (function prologue
and epilogue) for these functions
to save and restore the registers used by these functions, this can
SUBSTANTIALLY reduce code and improve run time performance of the
generated code. In the future the compiler (with inter procedural
analysis) will be able to determine the appropriate scheme to use
for each function call. DO NOT use this option for built-in functions
such as _mulint..., if this option is used for a library function
the appropriate library function needs to be recompiled with the same
option. If the project consists of multiple source files then all
the source file should be compiled with the same --callee-saves
option string. Also see #pragma callee_saves
ite:callee_saves-function1[,function2[,function3...]]-.
- [--all-callee-saves] Function
of --callee-saves will be applied to all functions by
default.
- [--debug] When this option is used
the compiler will generate debug information. The debug information
collected in a file with .cdb extension can be used with the SDCDB.
For more information see documentation for SDCDB. Another file with
no extension contains debug information in AOMF or AOMF51
format which is commonly used by third party tools.
- [-S] Stop after the stage of compilation proper;
do not assemble. The output is an assembler code file for the input
file specified.
- [--int-long-reent] Integer
(16 bit) and long (32 bit) libraries have been compiled as reentrant.
Note by default these libraries are compiled as non-reentrant. See
section Installation for more details.
- [--cyclomatic] This option will
cause the compiler to generate an information message for each function
in the source file. The message contains some important information
about the function. The number of edges and nodes the compiler detected
in the control flow graph of the function, and most importantly the
cyclomatic complexity see section
on Cyclomatic Complexity for more details.
- [--float-reent] Floating point
library is compiled as reentrant. See section Installation
for more details.
- [--funsigned-char] The default
signedness for every type is signed. In some embedded environments
the default signedness of char is unsigned. To set
the signess for characters to unsigned, use the option --funsigned-char.
If this option is set and no signedness keyword (unsigned/signed)
is given, a char will be signed. All other types are unaffected.
- [--main-return] This option
can be used if the code generated is called by a monitor program or
if the main routine includes an endless loop. This option results
in slightly smaller code and saves two bytes of stack space. The return
from the 'main' function will return to the function
calling main. The default setting is to lock up i.e. generate a 'sjmp
.'.
- [--nostdinc] This will prevent
the compiler from passing on the default include path to the preprocessor.
- [--nostdlib] This will prevent
the compiler from passing on the default library
path to the linker.
- [--verbose] Shows the various actions
the compiler is performing.
- [-V] Shows the actual commands the compiler
is executing.
- [--no-c-code-in-asm] Hides
your ugly and inefficient c-code from the asm file, so you can always
blame the compiler :)
- [--fverbose-asm] Include
code generator and peep-hole comments in the generated asm files.
- [--no-peep-comments] Don't
include peep-hole comments in the generated asm files even if --fverbose-asm
option is specified.
- [--i-code-in-asm] Include
i-codes in the asm file. Sounds like noise but is most helpful for
debugging the compiler itself.
- [--less-pedantic] Disable
some of the more pedantic warnings. For more details,
see the less_pedantic pragma ite:less_pedantic.
- [--disable-warning <nnnn>] Disable
specific warning with number <nnnn>.
- [--Werror] Treat all warnings as
errors.
- [--print-search-dirs] Display
the directories in the compiler's search path
- [--vc] Display errors and warnings using
MSVC style, so you can use SDCC with the visual studio IDE.
With SDCC both offering a GCC-like (the default) and a MSVC-like
output style, integration into most programming editors should be
straightforward.
- [--use-stdout] Send errors and
warnings to stdout instead of stderr.
- [-Wa asmOption[,asmOption]...] Pass
the asmOption to the assembler.
See file sdcc/as/doc/asxhtm.html for assembler options.cd
- [--std-sdcc89] Generally follow
the C89 standard, but allow SDCC features that conflict with the standard
(default).
- [--std-c89] Follow the C89 standard
and disable SDCC features that conflict with the standard.
- [--std-sdcc99] Generally follow
the C99 standard, but allow SDCC features that conflict with the standard
(incomplete support).
- [--std-c99] Follow the C99 standard
and disable SDCC features that conflict with the standard (incomplete
support).
- [--codeseg <Name>] The
name to be used for the code segment, default CSEG. This
is useful if you need to tell the compiler to put the code in a special
segment so you can later on tell the linker to put this segment in
a special place in memory. Can be used for instance when using bank
switching to put the code in a bank.
- [--constseg <Name>] The
name to be used for the const segment, default CONST.
This is useful if you need to tell the compiler to put the const data
in a special segment so you can later on tell the linker to put this
segment in a special place in memory. Can be used for instance when
using bank switching to put the const data in a bank.
- [--fdollars-in-identifiers] Permit
'$' as an identifier character.
- [--more-pedantic] Actually
this is not a SDCC compiler option but if you want
more warnings you can use a separate tool dedicated to syntax
checking like splint
http://www.splint.org. To make your source files parseable
by splint you will have to include lint.h
in your source file and add brackets around extended keywords (like
''__at (0xab)''
and ''__interrupt (2)'').
Splint has an excellent on line manual at http://www.splint.org/manual/
and it's capabilities go beyond pure syntax checking. You'll need
to tell splint the location of SDCC's include files so a typical command
line could look like this:
splint -I /usr/local/share/sdcc/include/mcs51/ myprogram.c
- [--short-is-8bits] Treat
short as 8-bit (for backward compatibility with older versions of
compiler - see section 1.4)
Next: 3.2.10 Intermediate Dump Options
Up: 3.2 Command Line Options
Previous: 3.2.8 Optimization Options
Contents
Index
2008-12-05