Turn on -Wall compiler flag and fix compiler warnings

This commit is contained in:
Rui Ueyama 2020-05-10 14:47:10 +09:00
parent b1fdddff15
commit 2c91da54df
2 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
CFLAGS=-std=c11 -g -fno-common
CFLAGS=-std=c11 -g -fno-common -Wall -Wno-switch
SRCS=$(wildcard *.c)
OBJS=$(SRCS:.c=.o)

View File

@ -9,6 +9,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
@ -79,9 +80,9 @@ struct Token {
Token *origin; // If this is expanded from a macro, the original token
};
void error(char *fmt, ...);
void error_at(char *loc, char *fmt, ...);
void error_tok(Token *tok, char *fmt, ...);
noreturn void error(char *fmt, ...);
noreturn void error_at(char *loc, char *fmt, ...);
noreturn void error_tok(Token *tok, char *fmt, ...);
void warn_tok(Token *tok, char *fmt, ...);
bool equal(Token *tok, char *op);
Token *skip(Token *tok, char *op);