]> git.sur5r.net Git - cc65/blobdiff - src/cc65/error.c
Fixed two compiler warnings.
[cc65] / src / cc65 / error.c
index bce570e34780c3033ac6f193f82178fd51067347..2fe399702fbf6418b44cee641822bdc49d1af68c 100644 (file)
@@ -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                                                */
@@ -64,12 +64,13 @@ unsigned WarningCount       = 0;
 IntStack WarnEnable         = INTSTACK(1);  /* Enable warnings */
 IntStack WarningsAreErrors  = INTSTACK(0);  /* Treat warnings as errors */
                                             /* Warn about: */
-IntStack WarnNoEffect       = INTSTACK(1);  /* ... statements without an effect */
-IntStack WarnStructParam    = INTSTACK(1);  /* ... structs passed by val */
-IntStack WarnUnusedLabel    = INTSTACK(1);  /* ... unused labels */
-IntStack WarnUnusedParam    = INTSTACK(1);  /* ... unused parameters */
-IntStack WarnUnusedVar      = INTSTACK(1);  /* ... unused variables */
-IntStack WarnUnknownPragma  = INTSTACK(1);  /* ... unknown #pragmas */
+IntStack WarnConstComparison= INTSTACK(1);  /* - constant comparison results */
+IntStack WarnNoEffect       = INTSTACK(1);  /* - statements without an effect */
+IntStack WarnStructParam    = INTSTACK(1);  /* - structs passed by val */
+IntStack WarnUnusedLabel    = INTSTACK(1);  /* - unused labels */
+IntStack WarnUnusedParam    = INTSTACK(1);  /* - unused parameters */
+IntStack WarnUnusedVar      = INTSTACK(1);  /* - unused variables */
+IntStack WarnUnknownPragma  = INTSTACK(1);  /* - unknown #pragmas */
 
 /* Map the name of a warning to the intstack that holds its state */
 typedef struct WarnMapEntry WarnMapEntry;
@@ -80,6 +81,7 @@ struct WarnMapEntry {
 static WarnMapEntry WarnMap[] = {
     /* Keep sorted, even if this isn't used for now */
     { &WarningsAreErrors,       "error"                 },
+    { &WarnConstComparison,     "const-comparison"      },
     { &WarnNoEffect,            "no-effect"             },
     { &WarnStructParam,         "struct-param"          },
     { &WarnUnknownPragma,       "unknown-pragma"        },
@@ -297,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                                    */
 /*****************************************************************************/