aboutsummaryrefslogtreecommitdiff
path: root/2015/01
diff options
context:
space:
mode:
authorMarvin Borner2021-11-30 21:53:46 +0100
committerMarvin Borner2021-11-30 21:53:46 +0100
commit3aa641542918765f6ceb039cfa64ff6f58597eb2 (patch)
treeb665282b581d22c4189c57286ff8625a708f60a9 /2015/01
parentf0566aee824569b8cd20186b40c9b9be53f9261a (diff)
Hype for tomorrow
Diffstat (limited to '2015/01')
-rw-r--r--2015/01/Makefile17
-rw-r--r--2015/01/solve.c7
2 files changed, 18 insertions, 6 deletions
diff --git a/2015/01/Makefile b/2015/01/Makefile
index 769d06d..57e1574 100644
--- a/2015/01/Makefile
+++ b/2015/01/Makefile
@@ -1,10 +1,19 @@
-.PHONY: solve.c
+DEBUG = -Wno-error -Og -ggdb3 -s -fsanitize=undefined -fsanitize=address -fstack-protector-all
+CFLAGS = -Wall -Wextra -Werror -Wshadow -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wnested-externs -Wformat=2 -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wswitch-default -Wswitch-enum -Wunreachable-code -Wundef -Wold-style-definition -Wvla -pedantic-errors -Ofast
-solve.o: solve.c
- @gcc $+ -o $@
+# Not the best makefile but idc
+
+debug:
+ @gcc $(CFLAGS) $(DEBUG) solve.c -o solve.o
+
+build:
+ @gcc $(CFLAGS) solve.c -o solve.o
clean:
@rm -f *.o
-run: solve.o
+run: debug
+ @./solve.o
+
+time: build
@./solve.o
diff --git a/2015/01/solve.c b/2015/01/solve.c
index 287bf3f..81a0ec4 100644
--- a/2015/01/solve.c
+++ b/2015/01/solve.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <time.h>
-int part_one(FILE *fp)
+static int part_one(FILE *fp)
{
int res = 0;
@@ -17,7 +17,7 @@ int part_one(FILE *fp)
return res;
}
-int part_two(FILE *fp)
+static int part_two(FILE *fp)
{
int res = 0, floor = 0;
@@ -39,6 +39,9 @@ int part_two(FILE *fp)
int main(int argc, char *argv[])
{
+ (void)argc;
+ (void)argv;
+
FILE *fp = fopen("input", "r");
if (!fp)
exit(EXIT_FAILURE);