Files
virtualjaguar-libretro/cppcheck-suppressions.txt
Joseph Mattiello b7bbef5a77 fix(ci): suppress the DSP shifter's inherited signed-shift portability finding
PR #571's DSP sh/sha port (P5) copies gpu_opcode_sha's shift-by-31
expression verbatim, which already carries a shiftTooManyBitsSigned
suppression for src/tom/gpu.c ("standard C UB, every target compiler
does arithmetic shift on signed"). The identical expression now
exists in src/jerry/dsp.c too and needs the same suppression -- not
a new issue, the same accepted one at a new site.

Verified with the exact CI cppcheck invocation locally: exit 0.
2026-08-22 05:53:01 -04:00

42 lines
2.0 KiB
Plaintext

# cppcheck suppressions for the libretro CI job.
#
# Each suppression is one of two shapes:
# <id>:<file> - suppress all <id> findings in <file>
# <id>:<file>:<line> - suppress one specific occurrence
#
# RULE: every entry needs a one-line comment. If you find yourself
# adding a suppression for a new issue, that's a hint the issue should
# probably be fixed instead.
# DSP / GPU RAM bounds: cppcheck doesn't model that GET16/GET32 macros
# read from a 2-byte / 4-byte sliding window inside the dsp_ram_8 /
# gpu_ram_8 backing arrays, and that the bounds check `offset <=
# BASE + (size - 1)` is one short for the 2-byte / 4-byte reads.
# These read past the declared array size by 1-3 bytes -- in practice
# the next byte is part of an adjacent register / pad and is unused,
# but it is technically OOB and worth a follow-up audit.
arrayIndexOutOfBoundsCond:src/jerry/dsp.c
arrayIndexOutOfBoundsCond:src/tom/gpu.c
# Blitter long-shift code paths are guarded by a runtime condition
# (cppcheck cites the guard explicitly in the "See condition at line
# N" note). Safe under the existing branch.
shiftTooManyBits:src/tom/blitter.c
# Pre-existing signed-int shift in the GPU shifter unit -- standard
# C UB (shifting a signed 32-bit value by 31 lands in the sign bit).
# Tracked for follow-up. The DSP shifter (dsp_opcode_sha, dsp.c) uses
# the identical expression -- it was ported verbatim from the GPU
# implementation (issue #569 P5) -- so it inherits the same suppression.
shiftTooManyBitsSigned:src/tom/gpu.c
shiftTooManyBitsSigned:src/jerry/dsp.c
# Object Processor sign-extension idiom: cast to int8_t then >> 4 to
# sign-extend a 4-bit nibble. Implementation-defined under C89 but
# every compiler we target does arithmetic shift on signed.
shiftNegativeLHS:src/tom/op.c
# libretro-common conditional includes that depend on host-platform
# macros cppcheck doesn't see (e.g. _WIN32, __APPLE__).
preprocessorErrorDirective:libretro-common/include/retro_common_api.h