โ C17 MOC ยท ๐ฏ Mission ยท Lesson 0001
LR-0003: CMake SDL2 Resolution & Integer Precision Diagnostics
Configuring CMake with both find_package(SDL2) and pkg-config fallback successfully resolves SDL2 headers on macOS (Homebrew /opt/homebrew/include/SDL2) and Linux. Enabling -Wconversion immediately flagged an implicit integer truncation bug in src/main.c where SDL_Keycode (32-bit integer) was assigned to char (8-bit integer).
๐ Evidence
CMakeLists.txtsuccessfully compiled all 7 object files and linked./build/chip8with ASan/UBSan instrumentation (Toolchain Reference).- Compiler emitted
-Wimplicit-int-conversiononsrc/main.c:41:39. - Connects with integer sizing and width rules mapped during the C Systems Diagnostic.
๐ Implications for Curriculum
- Transition to Lesson 0002: Safe Binary File I/O & ROM Loading into RAM at 0x200.
- Enforce explicit integer sizing (
int32_tvscharvsuint8_t) across all emulator structs to avoid implicit narrowing casts.
