Fix kernel warning audit issues#46
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
-Wall/pedantic builds which exposed many real bugs and dangerous casts across kernel subsystems.Description
UINT64_MAX, constrained SLP type bitshifts, added explicit I/O port casts, and fixed PM1 status wait precedence to(inw(...) & 1U) == 0U. (source/kernel/C/acpi-shutdown.c)static, replaced non-standard binary literals with portable masks, stored packets asuint8_t, fixed signed/unsigned movement math and framebuffer clamping, and synced PIT tick types with consumers. (source/kernel/C/user-input/ps2-mouse.c,source/kernel/C/user-input/keyboard.c,source/kernel/C/pit.c)cstringreturns, fixed AHCI BAR masking and pointer casts, widened GPU name storage and deferred GPU-global pointer assignment until stable storage exists. (source/kernel/C/pci_id.c,source/kernel/C/pci.c,source/includes/pci.h,source/includes/pci_id.h)verify_signatureconst-correct, fixed IDT pointer initialization and narrowed offset writes beforelidt. (source/kernel/C/executables/elf.c,source/includes/executables/fwde.h,source/kernel/C/executables/fwde.c,source/kernel/C/interrupts/idt.c)print_bitmapacceptconst bool*, fixedstrlen/string prototypes anditoavisibility, tightened RTC I/O casts and BCD conversions, adjusted logging/ISR prototypes and added missing prototypes for MSR helpers, and cleaned up unused/implicit prototypes across many headers. (multiplesource/includes/*andsource/kernel/C/*files)Testing
cd source && makewhich completed and linkedwing_kernel.elfsuccessfully (build artifacts present and linker step finished). (Succeeded)-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wwrite-strings -Wundef -Wformat=2 -Wswitch-enum -Werror ...) which still fails due to remaining FAT16/filesystem-related strict warnings; those areas were left for targeted manual review. (Failed — remaining issues infat16.cand a few other modules)Codex Task