diff options
author | aqua <aqua@iserlohn-fortress.net> | 2023-02-05 16:33:54 +0200 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2023-02-05 16:33:54 +0200 |
commit | 266473671effeaa49d7043eab2c18c23d85f5a91 (patch) | |
tree | 8417c09e123956957e8296bae72a5fb8ae9a5461 | |
parent | Remove makefile include targets (diff) | |
download | kernel-266473671effeaa49d7043eab2c18c23d85f5a91.tar.xz |
Make shadowing variables an error
-rw-r--r-- | Makefile.config | 4 | ||||
-rw-r--r-- | i686/toolchain.mk | 4 | ||||
-rw-r--r-- | rules.mk | 3 | ||||
-rw-r--r-- | src/multiboot2.c | 8 |
4 files changed, 9 insertions, 10 deletions
diff --git a/Makefile.config b/Makefile.config index bbff402..5252c0d 100644 --- a/Makefile.config +++ b/Makefile.config @@ -34,13 +34,13 @@ AS := i686-elf-as CC := i686-elf-gcc CCID := $(shell ${CC} --version | head -n1) -CFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 \ +CFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 \ -mgeneral-regs-only \ $(shell echo ${CONFIG_CFLAGS}) CXX := i686-elf-g++ CXXID := $(shell ${CXX} --version | head -n1) -CXXFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -ffreestanding -std=c++17 \ +CXXFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion -ffreestanding -std=c++17 \ -mgeneral-regs-only -fno-use-cxa-atexit -fno-threadsafe-statics -fno-exceptions -fno-rtti \ $(shell echo ${CONFIG_CXXFLAGS}) diff --git a/i686/toolchain.mk b/i686/toolchain.mk index e97443f..8294660 100644 --- a/i686/toolchain.mk +++ b/i686/toolchain.mk @@ -6,13 +6,13 @@ AS := i686-elf-as CC := i686-elf-gcc CCID := $(shell ${CC} --version | head -n1) -CFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 \ +CFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 \ -mgeneral-regs-only \ $(shell echo ${CONFIG_CFLAGS}) CXX := i686-elf-g++ CXXID := $(shell ${CXX} --version | head -n1) -CXXFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -ffreestanding -std=c++17 \ +CXXFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion -ffreestanding -std=c++17 \ -mgeneral-regs-only -fno-use-cxa-atexit -fno-threadsafe-statics -fno-exceptions -fno-rtti \ $(shell echo ${CONFIG_CXXFLAGS}) @@ -8,8 +8,7 @@ $(foreach V,$(filter %.SRCS, ${.VARIABLES}),\ # extra flags CFLAGS += -I../lib \ -Werror=implicit-function-declaration -CXXFLAGS += -I../lib -Drestrict=__restrict__ \ - -Werror=shadow +CXXFLAGS += -I../lib -Drestrict=__restrict__ # Suffix rules .SUFFIXES: .s .S .c .cpp .o diff --git a/src/multiboot2.c b/src/multiboot2.c index d3e4175..ea06e96 100644 --- a/src/multiboot2.c +++ b/src/multiboot2.c @@ -11,11 +11,11 @@ multiboot_strncpy(char *dest, const char *src, unsigned n) } __attribute__((section(".multiboot.text"))) void -multiboot2_module(struct multiboot_tag_module *tag, boot_info_t *info) +multiboot2_module(struct multiboot_tag_module *tag, boot_info_t *tag_info) { - info->module_start = tag->mod_start; - info->module_end = tag->mod_end; - multiboot_strncpy(info->module_cmdline, tag->cmdline, 64); + tag_info->module_start = tag->mod_start; + tag_info->module_end = tag->mod_end; + multiboot_strncpy(tag_info->module_cmdline, tag->cmdline, 64); } /** |