aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorbellard <bellard>2003-09-19 20:35:50 +0000
committerbellard <bellard>2003-09-19 20:35:50 +0000
commit9c1106d85411ef4691792c9b9dc612ba0a5383b1 (patch)
treea274716c1c7ae49c64d6aa8b62140f1f0083950b /tcc.c
parentf8d02417642ec58bd3da16ccdf042019e4918f52 (diff)
downloadtinycc-9c1106d85411ef4691792c9b9dc612ba0a5383b1.tar.gz
tinycc-9c1106d85411ef4691792c9b9dc612ba0a5383b1.tar.bz2
added -w option
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tcc.c b/tcc.c
index 68bf046..5a7673b 100644
--- a/tcc.c
+++ b/tcc.c
@@ -9549,9 +9549,18 @@ int tcc_set_warning(TCCState *s, const char *warning_name, int value)
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 @@ void help(void)
" -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 @@ enum {
TCC_OPTION_rdynamic,
TCC_OPTION_run,
TCC_OPTION_v,
+ TCC_OPTION_w,
};
static const TCCOption tcc_options[] = {
@@ -9684,6 +9695,7 @@ static const TCCOption tcc_options[] = {
{ "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 @@ int main(int argc, char **argv)
goto unsupported_option;
}
break;
+ case TCC_OPTION_w:
+ tcc_reset_warnings(s);
+ break;
case TCC_OPTION_rdynamic:
s->rdynamic = 1;
break;