Kernel: Enable even more warnings
This commit is contained in:
parent
dc389da74e
commit
b7ee746da3
@ -3,8 +3,8 @@ MOON_SRC := $(MOON_DIR)/src
|
|||||||
MOON_OBJ := $(MOON_DIR)/lib
|
MOON_OBJ := $(MOON_DIR)/lib
|
||||||
MOON_BIN := $(MOON_DIR)/bin
|
MOON_BIN := $(MOON_DIR)/bin
|
||||||
|
|
||||||
CFLAGS := -pedantic -Wall -Wextra -Werror -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion -Os -ffreestanding -fstack-protector-all -fno-omit-frame-pointer -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fshort-wchar -mcmodel=kernel -I$(MOON_DIR)/include -isystem $(MOON_DIR)/include/std
|
CFLAGS := -pedantic -Wall -Wextra -Werror -Wfloat-equal -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion -Os -ffreestanding -fstack-protector-all -fno-omit-frame-pointer -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fshort-wchar -mcmodel=kernel -I$(MOON_DIR)/include -isystem $(MOON_DIR)/include/std
|
||||||
CXXFLAGS := -fno-rtti -fno-exceptions
|
CXXFLAGS := -fno-rtti -fno-exceptions -Wsign-promo -Wstrict-null-sentinel -Wctor-dtor-privacy
|
||||||
ASMFLAGS := -felf64
|
ASMFLAGS := -felf64
|
||||||
LDFLAGS := -T$(MOON_DIR)/moon.ld -nostdlib -lgcc -Wl,--build-id=none -z max-page-size=0x1000
|
LDFLAGS := -T$(MOON_DIR)/moon.ld -nostdlib -lgcc -Wl,--build-id=none -z max-page-size=0x1000
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@ extern "C" void _start()
|
|||||||
kinfoln("Loading demo: memory eating program");
|
kinfoln("Loading demo: memory eating program");
|
||||||
Scheduler::load_user_task("bin/memeater");
|
Scheduler::load_user_task("bin/memeater");
|
||||||
break;
|
break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
kinfoln("Prepared scheduler tasks");
|
kinfoln("Prepared scheduler tasks");
|
||||||
|
@ -108,9 +108,9 @@ static void* liballoc_memset(void* s, int c, size_t n)
|
|||||||
static void* liballoc_memcpy(void* s1, const void* s2, size_t n)
|
static void* liballoc_memcpy(void* s1, const void* s2, size_t n)
|
||||||
{
|
{
|
||||||
char* cdest;
|
char* cdest;
|
||||||
char* csrc;
|
const char* csrc;
|
||||||
unsigned int* ldest = (unsigned int*)s1;
|
unsigned int* ldest = (unsigned int*)s1;
|
||||||
unsigned int* lsrc = (unsigned int*)s2;
|
const unsigned int* lsrc = (const unsigned int*)s2;
|
||||||
|
|
||||||
while (n >= sizeof(unsigned int))
|
while (n >= sizeof(unsigned int))
|
||||||
{
|
{
|
||||||
@ -119,7 +119,7 @@ static void* liballoc_memcpy(void* s1, const void* s2, size_t n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cdest = (char*)ldest;
|
cdest = (char*)ldest;
|
||||||
csrc = (char*)lsrc;
|
csrc = (const char*)lsrc;
|
||||||
|
|
||||||
while (n > 0)
|
while (n > 0)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ char* strncat(char* dest, const char* src, size_t n)
|
|||||||
size_t dest_len = strlen(dest);
|
size_t dest_len = strlen(dest);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < n && *(src + i); i++) *(char*)(dest + dest_len + i) = *(char*)(src + i);
|
for (i = 0; i < n && *(src + i); i++) *(char*)(dest + dest_len + i) = *(const char*)(src + i);
|
||||||
|
|
||||||
*(char*)(dest + dest_len + i) = '\0';
|
*(char*)(dest + dest_len + i) = '\0';
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ char* strcat(char* dest, const char* src)
|
|||||||
size_t dest_len = strlen(dest);
|
size_t dest_len = strlen(dest);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; *(src + i); i++) *(char*)(dest + dest_len + i) = *(char*)(src + i);
|
for (i = 0; *(src + i); i++) *(char*)(dest + dest_len + i) = *(const char*)(src + i);
|
||||||
|
|
||||||
*(char*)(dest + dest_len + i) = '\0';
|
*(char*)(dest + dest_len + i) = '\0';
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ char* strstr(char* haystack, const char* needle)
|
|||||||
|
|
||||||
void* memcpy(void* dest, const void* src, size_t n)
|
void* memcpy(void* dest, const void* src, size_t n)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < n; ++i) { *((char*)dest + i) = *((char*)src + i); }
|
for (size_t i = 0; i < n; ++i) { *((char*)dest + i) = *((const char*)src + i); }
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user