From ae62e89274f20cc0e3d526dfc613038d96820e1f Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 19 Dec 2025 17:54:51 +0100 Subject: driver: -w, update help --- common.h | 1 + io.c | 1 + main.c | 9 +++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common.h b/common.h index 862a271..6cf1b21 100644 --- a/common.h +++ b/common.h @@ -132,6 +132,7 @@ struct option { bool nocolor; bool pie, pic; bool werror; + bool wnone; enum optz { OPT0 = -1, OPT1 = 1, diff --git a/io.c b/io.c index 59481bd..cbb8568 100644 --- a/io.c +++ b/io.c @@ -1116,6 +1116,7 @@ warn(const struct span *span, const char *fmt, ...) { va_list ap; + if (ccopt.wnone) return; if (ccopt.werror) ++nerror; va_start(ap, fmt); vdiag(span, ccopt.werror ? DGERROR : DGWARN, fmt, ap); diff --git a/main.c b/main.c index b6b60f0..cf34f1e 100644 --- a/main.c +++ b/main.c @@ -217,6 +217,9 @@ optparse(char **args) ccopt.werror = 1; } /* TODO warning switches */ + } else if (*arg == 'w') { + ccopt.wnone = 1; + /* TODO warning switches */ } else Bad: warn(NULL, "unrecognized option: %'s", arg-1); } @@ -583,9 +586,11 @@ prihelp(void) " -llib \tLink with library\n" " -fpie \tEmit code for position independent executable\n" " -fpic \tEmit position independent code\n" - " -O0 \tTurn off optimizations\n" - " -O1 \tTurn on more optimizations\n" + " -O[0|1..] \tSet optimization level\n" " -x[c|o] \tSpecify type of next input file (C, object)\n" + " -W[...] \tTurn on warnings (stub)\n" + " -Werror \tTurn warnings into errors\n" + " -w \tSuppress warnings\n" ); } -- cgit v1.2.3