-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit ba0a6d5
committed
y2038: eliminate false positives with automatic build system detection
The Y2038 addon currently generates false positive warnings when scanning
codebases that are properly configured for Y2038 safety through build
system flags, making it impractical for comprehensive codebase analysis.
This prevents teams from running Y2038 checks across entire projects in
CI/CD pipelines due to noise from correctly configured code.
Add automatic build system detection to discover Y2038-related compiler
flags (_TIME_BITS=64, _FILE_OFFSET_BITS=64, _USE_TIME_BITS64) from:
- Makefile variants (Makefile, makefile, GNUmakefile, *.mk)
- CMake files (CMakeLists.txt, *.cmake)
- Meson build files (meson.build)
- Autotools scripts (configure, configure.ac, configure.in)
- Compiler flags passed via cppcheck -D options
When proper Y2038 configuration is detected (both _TIME_BITS=64 AND
_FILE_OFFSET_BITS=64), suppress Y2038 warnings and display an
informational message indicating the configuration source.
Implement hierarchical directory search up to 5 levels from source files
to locate relevant build files, with flag precedence: build system >
compiler flags > source code #define directives.
Add performance optimizations:
- Intelligent file caching with TTL-based invalidation
- UTF-8 BOM handling for cross-platform compatibility
- Robust import fallback system
Extend test suite with comprehensive coverage:
- Compiler flag parsing edge cases (18 test scenarios)
- Build system detection for all supported formats
- Caching behavior and performance validation
- Cross-platform file encoding handling
This enables organizations to run comprehensive Y2038 analysis on entire
codebases without false positives from properly configured projects,
while maintaining detection of actual Y2038 safety issues.1 parent 4780cd2 commit ba0a6d5Copy full SHA for ba0a6d5
File tree
Expand file treeCollapse file tree
5 files changed
+1236
-28
lines changedFilter options
- addons
- doc
- test
- y2038
Expand file treeCollapse file tree
5 files changed
+1236
-28
lines changed
0 commit comments