From 51c2e874b2eb0635851831d0805c5577284939ee Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Fri, 28 Feb 2025 08:57:41 +0500 Subject: [PATCH] [Makefile] -Wswitch-enum --- Makefile | 2 +- include/commonlib.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5935962..b536548 100644 --- 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= diff --git a/include/commonlib.h b/include/commonlib.h index 1604c4f..12a63c6 100644 --- a/include/commonlib.h +++ b/include/commonlib.h @@ -256,9 +256,9 @@ typedef struct { } c_String_view; #define c_SV_FMT "%.*s" -#define c_SV_ARG(sv) (int)sv.count, sv.data +#define c_SV_ARG(sv) (int)(sv).count, (sv).data -#define c_SV(cstr) (c_String_view){.data = cstr, strlen(cstr)} +#define c_SV(cstr) (c_String_view){.data = (char*)cstr, strlen(cstr)} void c_sv_print_dumb(c_String_view sv); c_String_view c_sv_from_cstr(const char* cstr); // Actually just use SV(cstr) macro... -- 2.39.5