Skip to content

Add cppcheck analysis shims and configure Codacy include paths#81

Merged
NathanNeurotic merged 2 commits into
mainfrom
codex/fix-cppcheck_missingincludesystem-warnings
Jan 7, 2026
Merged

Add cppcheck analysis shims and configure Codacy include paths#81
NathanNeurotic merged 2 commits into
mainfrom
codex/fix-cppcheck_missingincludesystem-warnings

Conversation

@NathanNeurotic

Copy link
Copy Markdown
Owner

Motivation

  • Silence Codacy/cppcheck missing-include warnings by supplying analysis-only headers and include paths so static analysis can see PS2SDK symbols.
  • Provide lightweight, non-functional typedefs/macros for PS2SDK and OSD APIs to avoid inventing runtime behavior.
  • Keep runtime behavior unchanged by gating all shims behind __CPPCHECK__ so normal builds use real SDK headers.

Description

  • Added include/cppcheck_shims.h which pulls in ps2sdk_shim.h and defines minimal typedefs, constants and stub OSD accessor functions used only for analysis.
  • Updated .codacy.yml to pass explicit cppcheck arguments and include paths (-Iinclude, -Itools/codacy_shims/ps2sdk, -Itools/codacy_shims/stdlib) so Codacy can use the repo shims during analysis.
  • Wrapped PS2SDK and other nonstandard includes with #ifdef __CPPCHECK__ to include the analysis shim instead of system headers in many headers and source files (examples: include/main.h, include/debugprintf.h, include/psx/plibcdvd_add.h, and multiple src/*.c files).
  • Changes are analysis-only (shims are compiled only when __CPPCHECK__ is defined) and do not alter runtime behavior or the public API.

Testing

  • No automated tests were executed as part of this change.
  • Static analysis can be exercised locally or in CI using the existing scripts/cppcheck.sh which now picks up the shim include paths.

Codex Task

@codacy-production

codacy-production Bot commented Jan 7, 2026

Copy link
Copy Markdown

Codacy's Analysis Summary

0 new issue (≤ 0 issue)
0 new security issue
5 complexity
0 duplications

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

@NathanNeurotic NathanNeurotic merged commit 7871961 into main Jan 7, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant