Repository navigation
Conversation
…round positive integers in macros (fixes false positives from clang -Wunreachable-code-return with -Wunreachable-code-aggressive).
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the macro cleanup intended to reduce Clang unreachable-code false positives.
No open issues 🎉
What changed in this PR
Removes redundant parentheses around integer-literal macros across wolfSSL, wolfCrypt, and tests to address false positives from Clang’s aggressive unreachable-code warnings, without changing numeric values.
Changes:
- Simplifies integer constants and constant-returning function-like macros.
- Preserves parentheses around compound expressions.
- Normalizes RNG limit suffixes from lowercase
lto uppercaseL.
| File | Description |
|---|---|
wolfssl/wolfcrypt/wolfentropy.h |
Simplifies entropy scaling constants. |
wolfssl/wolfcrypt/wc_xmss.h |
Simplifies XMSS length constants. |
wolfssl/wolfcrypt/wc_port.h |
Simplifies constant time macros. |
wolfssl/wolfcrypt/types.h |
Simplifies the compiler-version fallback macro. |
wolfssl/wolfcrypt/sp_int.h |
Simplifies the constant sign-check macro. |
wolfssl/wolfcrypt/settings.h |
Simplifies platform and key-size constants. |
wolfssl/wolfcrypt/random.h |
Simplifies RNG constants and normalizes long suffixes. |
wolfssl/wolfcrypt/async.h |
Simplifies the default thread priority. |
wolfssl/wolfcrypt/aes.h |
Simplifies the key-check fallback macro. |
wolfssl/quic.h |
Simplifies the record-capacity constant. |
wolfssl/openssl/x509.h |
Simplifies the compatibility flag constant. |
wolfssl/openssl/ssl.h |
Simplifies cipher-suite identifiers. |
wolfssl/internal.h |
Simplifies CRL and DTLS constants. |
wolfcrypt/test/test.c |
Simplifies test constants and a fallback macro. |
wolfcrypt/src/random.c |
Simplifies request-size and hardware-address constants. |
wolfcrypt/src/ecc.c |
Simplifies the GCM detection fallback macro. |
tests/api.c |
Simplifies static-memory test sizes. |
src/wolfio.c |
Simplifies the GNRC token-size constant. |
src/sniffer.c |
Simplifies key-log parsing length constants. |
Review effort: Balanced
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12072
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 17 of 19 in-scope changed file(s) opened by the reviewer; not opened: wolfssl/internal.h, wolfssl/quic.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
src/,test/,wolfcrypt/src/,wolfssl/: Remove frivolous parentheses around positive integers in macros (fixes false positives from clang-Wunreachable-code-returnwith-Wunreachable-code-aggressive).discovered with and tested by
changes were purely mechanical: