Shipping C means more than compiling—enable warnings, use sanitizers in CI, audit dependencies, and document memory ownership in APIs.
Checklist
-Wall -Wextra -Werrorin CI- AddressSanitizer / UBSan in test builds
- Static analysis (clang-tidy, cppcheck)
- Bounded string functions (
snprintf,strncpywith care) - Fuzz critical parsers (libFuzzer, AFL)
- Pin compiler versions for reproducible builds
Important interview questions and answers
- Q: Why -Werror?
A: Treats warnings as build failures—prevents shipping latent bugs. - Q: How prevent buffer overflows?
A: Bounds checks, safe APIs, sanitizers, and code review on all pointer arithmetic.
Self-check
- What sanitizer catches use-after-free?
- Why pin compiler versions in release builds?
Interview prep
- Why -Werror in CI?
Prevents merging code with warnings that often indicate real bugs—especially format string and pointer issues.
- Sanitizers in CI?
AddressSanitizer and UBSan catch memory errors during automated tests before production.