cc 7.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
cc
==

Norcroft C compiler.  Sources in Tools/Sources/cc.
See Acorn C/C++ Manual for further documentation.

Contents:
  Changes since cc 5.06
    New warnings and suppressing them
  Changes in cc 5.11
  Changes in cc 5.12
  Changes in cc 5.13 - 5.18
  List of all pragmas
  List of debug flags
  List of all feature flags
  List of all warning suppression flags
  List of all error suppression flags


Changes since version 5.06 are just the addition
of new warnings and warning suppression flags:

-Ws   suppression of "module has init to static data"
-Wr   suppression _swix format warnings
-Wc   suppression of "use of reserved C++ keyword" warnings
-Wb   suppression of unknown pragma warnings
-Wg   suppression of non-const format parameter warnings
        (..printf, ..scanf, _swix)

The compiler now knows (with #pragma -v4 in swis.h) about _swi
and _swix and will check that the correct number of parameters
have been supplied and that they are of suitable types.

The compiler now identifies *which* function parameter it is 
grumbling about when it has a complaint about one of them.


Changes in version 5.11 of the compiler:

-Ws is assumed and ignored, but not faulted.

-ccversion <version * 100> option is supported.  eg. --ccversion 512
will abort compilation if you aren't using version 5.12 or later.

A new macro __CC_NORCROFT_VERSION with a numeric value equal to the
version number * 100 is predefined.


Changes in version 5.12 of the compiler:

Signed shift right following a bitwise AND with a constant used to do
a logical shift, not arithmetic.  This is now fixed.  (C standard says
that the LSR/ASR choice is implementation defined - and our manual
defines it as ASR)


Changes in versions 5.13 through 5.19 of the compiler:

SFMFD instructions generated correctly, and other floating point instr fixes
too; LDR with writeback to sp as the base register done properly to avoid
interrupt holes; use of single register LDM and STM instructions minimised;
more warning suppression stuff added:

"Unused earlier static declaration of '<symbol>'" is only generated in
fussy mode.

Unused symbols starting with the 6 character prefix __link are no longer
warned about (because the linker set stuff nearly always should not be
referenced - that's what the linker does)

The following symbols may be predefined depending on the APCS variant in
use: __APCS_32, __APCS_FPREGARGS, __APCS_NOFP, __APCS_REENT, __APCS_NOSWST.



Full set of active pragmas:

The following comes from cfe/pp.c and maps the long pragma names to
the short versions.  The digit is the value to use with the short
versions to effect the same thing.  (ie. #pragma -v4 is the same
as #pragma check_swix_formats).  Do not use -v3 as it is for
internal use only (by the compiler's own source code).


    { "warn_implicit_fn_decls",     'a', 1},
    { "check_memory_accesses",      'c', 1},
    { "warn_deprecated",            'd', 1},
    { "continue_after_hash_error",  'e', 1},
    { "include_only_once",          'i', 1},
    { "optimise_crossjump",         'j', 1},
    { "optimise_multiple_loads",    'm', 1},
    { "profile",                    'p', 1},
    { "profile_statements",         'p', 2},
    { "check_stack",                's', 0},
    { "force_top_level",            't', 1},
    { "check_printf_formats",       'v', 1},
    { "check_scanf_formats",        'v', 2},
    { "__compiler_msg_format_check",'v', 3},
    { "check_swix_formats",         'v', 4},
    { "side_effects",               'y', 0},
    { "optimise_cse",               'z', 1}



Debug flags are used with -zq<option>.  Some options are
counted in that repeating them increases the debug level.
Such options are marked with <n> in the list below.  It
is expected that very few people will need to know these
(only people modifying the compiler itself, probably).
Options can be combined in a single flag, eg. -zqvvcka

Option       Meaning

-zqa         AETREE
-zqb         binder
-zqc  <n>    common sub-expression eliminator
-zqd         debug data
-zqf         filename processing
-zqg         code generator
-zqh         register spilling
-zqi         file activity
-zqk  <n>    local code generator
-zql         lexer
-zqm         map storage
-zqo         object code constructor
-zqp         pre-processor
-zqq         DEBUG_Q ??
-zqr         register allocation
-zqs         syntax analysis
-zqt         type checker
-zqu         storage
-zqw         storage (2)
-zqx         DEBUG_X ??
-zqy         loop analysis
-zqz  <n>    disable SIGINT signal handler (allows backtraces)


List of all feature flags:  (* = documented in Acorn C/C++ manual)

Option       Meaning

-fa          Check for certain data flow anomalies. (*)
-fb	     Verbose
-fc	     Limited pcc option (*)
-fd          Unused.
-fe          Check 6-char case-insensitive external symbols unique (*)
-ff          Don't embed function names (cf. -fn) (*)
-fg          Unused
-fh          Require pre-declaration of external objects (*)
-fi          Retain #include "..." statements in listing output (*)
-fj          Return #include <...> statements in listing output (*)
-fk          Use K&R include search rules (*)
-fl          Don't use link register
-fm          Emit warning for unused preprocessor symbols (*)
-fn          Embed function names (cf. -ff) (*)
-fo          Warn about old-style functions
-fp          Report on explicit casts of integers to pointer (*)
-fq          Allow counted strings
-fr          Let longjmp() corrupt register variables
-fs          Annotate
-ft          Unused
-fu          Unexpanded listing (*)
-fv          Report on all unused declarations including standard headers (*)
-fw          Allow string literals to be writable (*)
-fx          Unused
-fy          Unused
-fz          Inline calls kill link register.


List of all warning suppression flags: (* = documented in Acorn C/C++ manual)

Option       Meaning

-Wa          "Use of = in a conditional context" (*)
-Wb          Unknown pragma
-Wc          Use of C++ keyword
-Wd          Deprecated declaration foo() - give arg types (*)
-We          Unused
-Wf          Inventing "extern int foo()" (*)
-Wg          'format' arg to printf/scanf/_swixs etc. is variable
-Wh - -Wm    Unused
-Wn          Implicit narrowing cast (*)
-Wo          Unused
-Wp          non-ANSI #include <...> (*)
-Wq          Unused
-Wr          (_swix) Format requires x parameters, but y given
-Ws          Module has init. to static data
-Wt          Unused
-Wu          Unused
-Wv          Implicit return in non-void context (*)
-Ww - -Wz    Unused


List of all error suppression flags:

(* = documented in Acorn C/C++ manual)
(! = documented in manual, but not actually implemented in the compiler)

Option       Meaning

-Ea          Unused
-Eb          Unused
-Ec          Implicit cast (*)
-Ed          Unused
-Ee          Unused
-Ef          Unclean casts (eg. short to pointer) (!)
-Eg          Unused
-Eh          Unused
-Ei          Suppress syntax checking for #if (!)
-Ej          Unused
-Ek          Unused
-El          Unused
-Em          Same as -Epz -fq
-En          Unused
-Eo          Unused
-Ep          Junk at end of preprocessor line (*)
-Eq - Ey     Unused
-Ez          Zero-length array (*)


--sbrodie, 26/04/2000