-Os Inline some known functions
-T Include source as comment
-V Print the compiler version number
- -W Suppress warnings
+ -W warning[,...] Suppress warnings
-d Debug mode
-g Add debug info to object file
-h Help (this text)
--help Help (this text)
--include-dir dir Set an include directory search path
--list-opt-steps List all optimizer steps and exit
+ --list-warnings List available warning types for -W
--local-strings Emit string literals immediately
--memory-model model Set the memory model
--register-space b Set space available for register variables
Print the short option summary shown above.
+ <label id="option-list-warnings">
+ <tag><tt>--list-warnings</tt></tag>
+
+ List the names of warning types available for use with <tt><ref
+ id="option-W" name="-W"></tt>.
+
+
<label id="option-local-strings">
<tag><tt>--local-strings</tt></tag>
Warn about unused variables.
</descrip>
+ The full list of available warning names may be retrieved by using the
+ option <tt><ref id="option-list-warnings" name="--list-warnings"></tt>.
+
You may also use <tt><ref id="pragma-warn" name="#pragma warn"></tt> to
control this setting for smaller pieces of code from within your code.
/* */
/* */
/* */
-/* (C) 1998-2010, Ullrich von Bassewitz */
+/* (C) 1998-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
+void ListWarnings (FILE* F)
+/* Print a list of warning types/names to the given file */
+{
+ unsigned I;
+ for (I = 0; I < sizeof(WarnMap) / sizeof (WarnMap[0]); ++I) {
+ fprintf (F, "%s\n", WarnMap[I].Name);
+ }
+}
+
+
+
/*****************************************************************************/
/* Code */
/*****************************************************************************/
/* */
/* */
/* */
-/* (C) 1998-2010, Ullrich von Bassewitz */
+/* (C) 1998-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
+#include <stdio.h>
+
/* common */
#include "attrib.h"
#include "intstack.h"
* intstack that holds its state. Return NULL if there is no such warning.
*/
+void ListWarnings (FILE* F);
+/* Print a list of warning types/names to the given file */
+
void ErrorReport (void);
/* Report errors (called at end of compile) */
" -Os\t\t\t\tInline some known functions\n"
" -T\t\t\t\tInclude source as comment\n"
" -V\t\t\t\tPrint the compiler version number\n"
- " -W\t\t\t\tSuppress warnings\n"
+ " -W warning[,...]\t\tSuppress warnings\n"
" -d\t\t\t\tDebug mode\n"
" -g\t\t\t\tAdd debug info to object file\n"
" -h\t\t\t\tHelp (this text)\n"
" --help\t\t\tHelp (this text)\n"
" --include-dir dir\t\tSet an include directory search path\n"
" --list-opt-steps\t\tList all optimizer steps and exit\n"
+ " --list-warnings\t\tList available warning types for -W\n"
" --local-strings\t\tEmit string literals immediately\n"
" --memory-model model\t\tSet the memory model\n"
" --register-space b\t\tSet space available for register variables\n"
static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
/* Add an include search path */
-{
+{
AddSearchPath (SysIncSearchPath, Arg);
AddSearchPath (UsrIncSearchPath, Arg);
}
+static void OptListWarnings (const char* Opt attribute ((unused)),
+ const char* Arg attribute ((unused)))
+/* List all warning types */
+{
+ /* List the warnings */
+ ListWarnings (stdout);
+
+ /* Terminate */
+ exit (EXIT_SUCCESS);
+}
+
+
+
static void OptLocalStrings (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Emit string literals immediately */
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--list-opt-steps", 0, OptListOptSteps },
+ { "--list-warnings", 0, OptListWarnings },
{ "--local-strings", 0, OptLocalStrings },
{ "--memory-model", 1, OptMemoryModel },
{ "--register-space", 1, OptRegisterSpace },