Fix output of --help regarding -W. Added new option --list-warnings.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5005 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2010, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -299,6 +299,17 @@ IntStack* FindWarning (const char* Name)
|
||||
|
||||
|
||||
|
||||
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 */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2010, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -38,6 +38,8 @@
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* common */
|
||||
#include "attrib.h"
|
||||
#include "intstack.h"
|
||||
@@ -106,6 +108,9 @@ IntStack* FindWarning (const char* Name);
|
||||
* 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) */
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ static void Usage (void)
|
||||
" -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"
|
||||
@@ -123,6 +123,7 @@ static void Usage (void)
|
||||
" --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"
|
||||
@@ -543,7 +544,7 @@ static void OptHelp (const char* Opt attribute ((unused)),
|
||||
|
||||
static void OptIncludeDir (const char* Opt attribute ((unused)), const char* Arg)
|
||||
/* Add an include search path */
|
||||
{
|
||||
{
|
||||
AddSearchPath (SysIncSearchPath, Arg);
|
||||
AddSearchPath (UsrIncSearchPath, Arg);
|
||||
}
|
||||
@@ -563,6 +564,19 @@ static void OptListOptSteps (const char* Opt attribute ((unused)),
|
||||
|
||||
|
||||
|
||||
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 */
|
||||
@@ -769,6 +783,7 @@ int main (int argc, char* argv[])
|
||||
{ "--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 },
|
||||
|
||||
Reference in New Issue
Block a user