diff --git a/Makefile b/Makefile index 125f1acf..0964a45e 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ PNGLDLIBS := `${PKG_CONFIG} --static --libs-only-l libpng` VERSION_STRING := `git describe --tags --dirty --always 2>/dev/null` -WARNFLAGS := -Werror -Wall -Wpedantic +WARNFLAGS := -Werror -Wall -Wextra -Wpedantic -Wno-sign-compare # Overridable CFLAGS CFLAGS := -g diff --git a/src/asm/asmy.y b/src/asm/asmy.y index ea964260..93d3f0f4 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -341,8 +341,9 @@ static void if_skip_to_else(void) break; case '\"': - src++; + src += 2; inString = false; + break; default: src++; diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 6b7141e9..19d58e20 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -257,8 +257,10 @@ FILE *fstk_FindFile(char *fname) * space had been available. Thus, a return value of `size` or * more means that the output was truncated. */ - if (snprintf(path, sizeof(path), "%s%s", IncludePaths[i], fname) - >= sizeof(path)) + int fullpathlen = snprintf(path, sizeof(path), "%s%s", + IncludePaths[i], fname); + + if (fullpathlen >= (int)sizeof(path)) continue; f = fopen(path, "rb"); diff --git a/src/asm/globlex.c b/src/asm/globlex.c index 79a8583d..9dae47bc 100644 --- a/src/asm/globlex.c +++ b/src/asm/globlex.c @@ -216,7 +216,7 @@ uint32_t PutMacroArg(char *src, uint32_t size) return 0; } -uint32_t PutUniqueArg(char *src, uint32_t size) +uint32_t PutUniqueArg(__attribute ((unused)) char *src, uint32_t size) { char *s; diff --git a/src/asm/main.c b/src/asm/main.c index 4a551a88..3996ff89 100644 --- a/src/asm/main.c +++ b/src/asm/main.c @@ -225,7 +225,7 @@ void opt_AddDefine(char *s) static void opt_ParseDefines(void) { - int32_t i; + uint32_t i; for (i = 0; i < cldefines_index; i += 2) sym_AddString(cldefines[i], cldefines[i + 1]); diff --git a/src/asm/symbol.c b/src/asm/symbol.c index c673e10c..24bcb385 100644 --- a/src/asm/symbol.c +++ b/src/asm/symbol.c @@ -62,7 +62,7 @@ void helper_RemoveLeadingZeros(char *string) memmove(string, new_beginning, strlen(new_beginning) + 1); } -int32_t Callback_NARG(struct sSymbol *sym) +int32_t Callback_NARG(__attribute__ ((unused)) struct sSymbol *sym) { uint32_t i = 0; @@ -673,7 +673,7 @@ void sym_AddReloc(char *tzSym) struct sSymbol *parent = pScope->pScope ? pScope->pScope : pScope; - int32_t parentLen = localPtr - tzSym; + uint32_t parentLen = localPtr - tzSym; if (strchr(localPtr + 1, '.') != NULL) { fatalerror("'%s' is a nonsensical reference to a nested local symbol", diff --git a/src/gfx/main.c b/src/gfx/main.c index 6171676d..b58e39f8 100644 --- a/src/gfx/main.c +++ b/src/gfx/main.c @@ -53,6 +53,7 @@ int main(int argc, char *argv[]) break; case 'F': opts.hardfix = true; + /* fallthrough */ case 'f': opts.fix = true; break;