summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-02-10 23:39:57 +0100
committerOskar <[email protected]>2024-02-10 23:39:57 +0100
commitcbaeb6f6a24532b5ecbc4fea4dcb329961ad4e37 (patch)
treea980b51ea34b196ee99e5f9dec1b26f3d92b9403
parent6d15b3fc79e01fea1db05a6906596798fee4beaa (diff)
Makefile changes because of some errors i cannot explain when using clang. Maybe its just me i don't know but i can not figure it out
-rw-r--r--Makefile4
-rw-r--r--startmode.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index aa9ed13..60578f9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-CC=clang
-CFLAGS=-Wfatal-errors -Wall -Werror -Wextra -g -O2
+CC=gcc
+CFLAGS=-Wfatal-errors -Wall -Werror -Wextra -g -O2 -static
CFLAGS_TESTBIN=-Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address
TARGET=7ed
TESTTARGET=7ed-TESTING
diff --git a/startmode.c b/startmode.c
index f65a8c6..9a760b1 100644
--- a/startmode.c
+++ b/startmode.c
@@ -39,7 +39,10 @@ int startmode(char filename[]) {
while(1) {
firstwhile:
- count_lines_in_file(filename, &Flines); // I do not know WHY i can not have this return to a variable??
+ int ret = count_lines_in_file(filename, &Flines);
+ if (ret == 1) {
+ return EXIT_FAILURE;
+ } // I do not know WHY i can not have this return to a variable??
// For some reason whenever i do int x = count_lines_in_file(.....) it will NOT compile
// I can not for the life of me figure out what the compiler is trying to say about the"expected expression" error
// I HAVE DONE THE SAME THING EVERYWHERE ELSE WHY WOULD IT INEXPLICABLY NOT WORK SPECIFICALLY HERE?