aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Winston2024-06-06 22:44:58 -0400
committerBen Winston2024-06-06 22:44:58 -0400
commitac40afe547d1cdc1182f487cf03e2a987427f632 (patch)
treecf0a22ea89952ad107bc5d086ae4b8cb003de5bb
parent5b163ece6dbdad4867902c1d30de644062a2b0ab (diff)
add -Wall and -Werror
-rw-r--r--Makefile2
-rw-r--r--booki.c7
2 files changed, 2 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 8b76acd..f729af1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,2 @@
build:
- cc *.c -o booki
+ cc *.c -Wall -Werror -o booki
diff --git a/booki.c b/booki.c
index 770ea00..606471b 100644
--- a/booki.c
+++ b/booki.c
@@ -482,9 +482,6 @@ const char* get_last_word(const char* str) {
}
long parse_int(char* current_pos, char** new_pos) {
- char c;
- char* value;
-
// strtol can handle leading spaces
// will put the first non-digit into endptr
char* endptr;
@@ -515,8 +512,6 @@ long parse_int(char* current_pos, char** new_pos) {
struct es parse_string(char* current_pos, char** new_pos) {
// TODO handle failure
-
- char c;
char* value;
// leading spaces
@@ -570,7 +565,7 @@ struct es parse_strings(char* current_pos, char** new_pos) {
*new_pos = current_pos;
return head;
} else {
- printf("error at %x\n", current_pos);
+ printf("error! +/- 10 context:\n---\n%.21s\n---\n", current_pos - 10);
SEEK_UNTIL(current_pos, '\n');
*new_pos = current_pos;
return default_es;