diff options
| author | Tom Harley | 2019-10-30 14:38:00 +0000 |
|---|---|---|
| committer | Tom Harley | 2019-10-30 14:38:00 +0000 |
| commit | 935600fb9612ef569f1f68f60b0b7cdd57ce7af6 (patch) | |
| tree | ae1f15d7f1a72ed494be43f9796c1d4da0fd848a /parse.y | |
| parent | Box everything (diff) | |
| download | sinter-935600fb9612ef569f1f68f60b0b7cdd57ce7af6.tar.gz sinter-935600fb9612ef569f1f68f60b0b7cdd57ce7af6.zip | |
Enable -Weverything
Clang has a -Weverything option, that enables all compile-time warnings and elevates them all to errors. This option is now passed to the compiler, and all warnings/errors the code produced have been addressed.
Using -Weverything locks the project into using clang as its compiler: this should not be a problem since clang is probably being used to compile the LLVM output of the project anyway. If support for other compilers is required, it should be simple enough to replace -Weverything with an equivalent collection of portable flags.
Explicit Makefile rules for compiling the C files produced by flex/bison are now included in the project since these C files absolutely do not pass -Weverything checks.
Diffstat (limited to 'parse.y')
| -rw-r--r-- | parse.y | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -7,13 +7,13 @@ #include "basic.h" extern int yylineno; -int yylex(); +int yylex(void); void yyerror(char *s, ...); %} %union { - float f; + double f; int i; char *s; sexpr *u; @@ -53,7 +53,10 @@ void yyerror(char *s, ...) { va_list ap; va_start(ap, s); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wformat-nonliteral" fprintf(stderr, "%d: error: ", yylineno); vfprintf(stderr, s, ap); fprintf(stderr, "\n"); +#pragma clang diagnostic pop } |
