// Cppcheck 2.13 suppressions for s2n-tls
// All suppressions are scoped to specific files and verified against cppcheck 2.13.0 (Ubuntu 24.04).

// cppcheck Message: (warning:arrayIndexOutOfBoundsCond) Either the condition 'c=='0'' is redundant
// or the array 'hex_to_value[1]' is accessed at index 48, which is out of bounds.
// Reason: hex_to_value uses C99 designated initializers sized to the largest index ('f' = 102).
// Bounds are validated before access via s2n_stuffer_peek_char.
arrayIndexOutOfBoundsCond:stuffer/s2n_stuffer_hex.c

// cppcheck Message: (error:preprocessorErrorDirective) #error "Expected s2n_prelude.h to be
// included as part of the compiler flags"
// Reason: s2n_prelude.h is force-included via compiler flags (-include s2n_prelude.h) during
// real builds. Cppcheck does not replicate this, so #error guards trigger incorrectly.
preprocessorErrorDirective:tests/unit/s2n_build_test.c
preprocessorErrorDirective:tls/s2n_config.c

// cppcheck Message: (warning:nullPointerRedundantCheck) Either the condition 'psk==NULL' is
// redundant or there is possible null pointer dereference: psk.
// Reason: psk is NULL when the early data client branch did not execute. Both NULL and
// non-NULL paths are valid and intentional per RFC 8446.
nullPointerRedundantCheck:tls/s2n_tls13_secrets.c

// cppcheck Message: (error:danglingLifetime) Non-local variable '.client_policy' will use
// object that points to local variable 'singleton_test_policy'.
// Reason: False positive. The local variable outlives the pointer usage within the same
// test scope. The struct is used only within the test function.
danglingLifetime:tests/unit/s2n_tls13_pq_handshake_test.c
