[Makefile] -Wswitch-enum
authorahmedsamyh <ahmedsamyh10@gmail.com>
Fri, 28 Feb 2025 03:57:41 +0000 (08:57 +0500)
committerahmedsamyh <ahmedsamyh10@gmail.com>
Fri, 28 Feb 2025 03:57:41 +0000 (08:57 +0500)
Makefile
include/commonlib.h

index 59359629d62e33bd5dc40bb66db550fc9b499862..b53654832ad3aff926a8dad6106e707dbb25792a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -Wextra -ggdb -I./include -fsanitize=address
+CFLAGS=-Wall -Wextra -ggdb -I./include -fsanitize=address -Wswitch-enum
 LDFLAGS=-L./lib
 LIBS=
 
index 1604c4f646a8eafb992cf37683a1c73eebcc5aee..12a63c6a7a361eac92e96099e75272f7af400ed6 100644 (file)
@@ -256,9 +256,9 @@ typedef struct {
 } c_String_view;\r
 \r
 #define c_SV_FMT "%.*s"\r
-#define c_SV_ARG(sv) (int)sv.count, sv.data\r
+#define c_SV_ARG(sv) (int)(sv).count, (sv).data\r
 \r
-#define c_SV(cstr) (c_String_view){.data = cstr, strlen(cstr)}\r
+#define c_SV(cstr) (c_String_view){.data = (char*)cstr, strlen(cstr)}\r
 \r
 void c_sv_print_dumb(c_String_view sv);\r
 c_String_view c_sv_from_cstr(const char* cstr); // Actually just use SV(cstr) macro...\r