Quick Contact

โœ‰
fahimkhan20148@gmail.com
๐Ÿ“ฑ
+971 507 286 133
Back to Notes
August 25, 2026
teach/c17learning-recordcmake

โ† 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.txt successfully compiled all 7 object files and linked ./build/chip8 with ASan/UBSan instrumentation (Toolchain Reference).
  • Compiler emitted -Wimplicit-int-conversion on src/main.c:41:39.
  • Connects with integer sizing and width rules mapped during the C Systems Diagnostic.

๐Ÿš€ Implications for Curriculum