This options allows finer control about speed vs. size decisions in the code
generation and optimization phases. It gives the allowed size increase
factor (in percent). The default is 100 when not using <tt/-Oi/ and 200 when
- using <tt/-Oi/ (<tt/-Oi/ is the same as <tt/--codesize 200/).
+ using <tt/-Oi/ (<tt/-Oi/ is the same as <tt/-O --codesize 200/).
<tag><tt>--cpu CPU</tt></tag>
<item>cc65
</itemize>
+ Please note that the compiler does not support the c99 standard and never
+ will. c99 mode is actually c89 mode with a few selected c99 extensions
+ (// comments for example).
+
<tag><tt>-t target, --target target</tt></tag>
runtime functions would have been called, even if the generated code is
larger. This will not only remove the overhead for a function call, but will
make the code visible for the optimizer. <tt/-Oi/ is an alias for
- <tt/--codesize 200/.
+ <tt/-O --codesize 200/.
<tt/-Or/ will make the compiler honor the <tt/register/ keyword. Local
variables may be placed in registers (which are actually zero page
<sect>Differences to the ISO standard<p>
+Apart from the things listed below, the compiler does support additional
+keywords, has several functions in the standard headers with names outside the
+reserved namespace and a few syntax extensions. All these can be disabled with
+the <tt><ref id="option--standard" name="--standard"></tt> command line
+option. Its use for maximum standards compatibility is advised.
+
Here is a list of differences between the language, the compiler accepts,
and the one defined by the ISO standard:
<itemize>
-<item> The compiler allows unnamed parameters in parameter lists. The
- compiler will not issue warnings about unused parameters that don't
- have a name. This feature can be disabled with the <tt><ref
- id="option--standard" name="--standard"></tt> command line option.
- <p>
-<item> The compiler has some additional keywords:
- <p>
- <itemize>
- <item><tt/asm/
- <item><tt/__asm__/
- <item><tt/fastcall/
- <item><tt/__fastcall__/
- <item><tt/__AX__/
- <item><tt/__EAX__/
- <item><tt/__func__/
- <item><tt/__attribute__/
- </itemize>
- <p>
- The keywords without the underlines can be disabled with the
- <tt><ref id="option--standard" name="--standard"></tt> command line
- option.
- <p>
<item> The datatypes "float" and "double" are not available.
<p>
-<item> The compiler does not support bit fields.
- <p>
<item> C Functions may not return structs (or unions), and structs may not
be passed as parameters by value. However, struct assignment *is*
possible.
conventions (see below). It means that you must not mix pointers to
those functions with pointers to user-written, not-fastcall functions.
<p>
+<item> The <tt/volatile/ keyword doesn't have an effect. This is not as bad
+ as it sounds, since the 6502 has so few registers that it isn't
+ possible to keep values in registers anyway.
+ <p>
</itemize>
There may be some more minor differences I'm currently not aware of. The
<tag><tt>__APPLE2ENH__</tt></tag>
- This macro is defined if the target is the enhanced Apple // (-t apple2enh).
+ This macro is defined if the target is the enhanced Apple //e (-t apple2enh).
<tag><tt>__ATARI__</tt></tag>
<p>
+<sect>Implementation-defined behavior<p>
+
+This section describes the behavior of cc65 when the standard describes the
+behavior as implementation-defined.
+
+(to be done)
+
<sect>Bugs/Feedback<p>
If you have problems using the compiler, if you find any bugs, or if you're