changeset 284:8ab5c15040ff

[project @ 2003-09-19 20:35:50 by bellard] added -w option
author bellard
date Fri, 19 Sep 2003 20:35:50 +0000
parents 5bd410aefdc4
children 96460040254e
files tcc.c
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Sun Jul 20 19:19:59 2003 +0000
+++ b/tcc.c	Fri Sep 19 20:35:50 2003 +0000
@@ -9549,9 +9549,18 @@
     return 0;
 }
 
-
 #if !defined(LIBTCC)
 
+static void tcc_reset_warnings(TCCState *s)
+{
+    int i;
+    const WarningDef *p;
+
+    for(i = 0, p = warning_defs; i < countof(warning_defs); i++, p++) {
+        *(int *)((uint8_t *)s + p->offset) = 0;
+    }
+}
+
 /* extract the basename of a file */
 static const char *tcc_basename(const char *name)
 {
@@ -9596,6 +9605,7 @@
            "  -bench      output compilation statistics\n"
  	   "  -run        run compiled source\n"
            "  -Wwarning   set or reset (with 'no-' prefix) 'warning'\n"
+           "  -w          disable all warnings\n"
            "Preprocessor options:\n"
            "  -Idir       add include path 'dir'\n"
            "  -Dsym[=val] define 'sym' with value 'val'\n"
@@ -9652,6 +9662,7 @@
     TCC_OPTION_rdynamic,
     TCC_OPTION_run,
     TCC_OPTION_v,
+    TCC_OPTION_w,
 };
 
 static const TCCOption tcc_options[] = {
@@ -9684,6 +9695,7 @@
     { "nostdlib", TCC_OPTION_nostdlib, 0 },
     { "print-search-dirs", TCC_OPTION_print_search_dirs, 0 }, 
     { "v", TCC_OPTION_v, 0 },
+    { "w", TCC_OPTION_w, 0 },
     { NULL },
 };
 
@@ -9859,6 +9871,9 @@
                         goto unsupported_option;
                 }
                 break;
+            case TCC_OPTION_w:
+                tcc_reset_warnings(s);
+                break;
             case TCC_OPTION_rdynamic:
                 s->rdynamic = 1;
                 break;