diff --git a/Makefile b/Makefile index 029efdc..4226ccc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ LIBFL = /opt/local/lib/libfl.a -CFLAGS+=-I/opt/local/include -Wall -Werror +CFLAGS+=-I/opt/local/include -Weverything -Wno-padded -Werror -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-statement-expression #-DDEBUG flex: flex lisp_scanner.rl diff --git a/parser.c b/parser.c index 7803acf..5dc08b3 100644 --- a/parser.c +++ b/parser.c @@ -3,6 +3,7 @@ #include #include "base.h" #include "symbol_table.h" +#include "parser.h" /* lisp_program -> atom|list @@ -17,7 +18,7 @@ list -> "(" expr+ ")" extern char *yytext; extern int yylex(); -const char * lex(){ +static const char * lex(){ if (yylex() == 0) { return nil; } @@ -92,7 +93,7 @@ static struct object * lisp_program(){ return atom_or_list(); } -struct object * parse(){ +static struct object * parse(){ _sym = (char *)lex(); return lisp_program(); } diff --git a/parser.h b/parser.h index 2da8e26..3b1003c 100644 --- a/parser.h +++ b/parser.h @@ -3,6 +3,6 @@ enum symbol_types { SYMBOL, OPENING_BRACE, CLOSING_BRACE }; -struct object * parse(); struct object * parse_string(char *s); + #endif diff --git a/symbol_table.c b/symbol_table.c index 7cf7017..78af75f 100644 --- a/symbol_table.c +++ b/symbol_table.c @@ -17,7 +17,7 @@ struct object * st_insert(char * name){ o->function_p = false; o->symbol_index = st.size; - int length = strlen(name); + size_t length = strlen(name); strncpy(sym->name, name, length); st.size++; diff --git a/tinylisp.c b/tinylisp.c index 660b0b1..cbc6da3 100644 --- a/tinylisp.c +++ b/tinylisp.c @@ -4,8 +4,8 @@ #include "symbol_table.h" #include "parser.h" -extern struct object * globals; -extern struct object * globals_end; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" int main(int argc, char **argv){ char * s; @@ -21,4 +21,4 @@ int main(int argc, char **argv){ return 0; } - +#pragma clang diagnostic pop