Skip to content

20240930-clang-tidy#8031

Merged
SparkiDev merged 1 commit intowolfSSL:masterfrom
douzzer:20240930-clang-tidy
Oct 1, 2024
Merged

20240930-clang-tidy#8031
SparkiDev merged 1 commit intowolfSSL:masterfrom
douzzer:20240930-clang-tidy

Conversation

@douzzer
Copy link
Copy Markdown
Contributor

@douzzer douzzer commented Oct 1, 2024

fixes, coddling, and suppressions for new true-positive clang-tidy complaints:

examples/pem/pem.c: fix stdio stream leaks.

src/ssl.c and src/ssl_load.c: suppress concurrency-mt-unsafe around getenv(). getenv() is threadsafe as long as no threads putenv() or setenv().

wolfssl/openssl/asn1.h: add parentheses to fix bugprone-macro-parentheses in ASN1_EX_TEMPLATE_TYPE(), and suppress misfiring bugprone-macro-parentheses around IMPLEMENT_ASN1_FUNCTIONS().

detected and tested with wolfssl-multi-test.sh ... super-quick-check with sys-devel/clang-20.0.0_pre20240924

note new suppression added to wolfssl-multi-test.sh for this:

-    export CLANG_TIDY_PER_FILE_CHECKS='^(src|wolfcrypt)/:concurrency-mt-unsafe ^examples/:-clang-analyzer-unix.Stream ^wolfcrypt/src/sp_(sm2_)?(arm|c|dsp|x86).*\.c:-readability-redundant-preprocessor,-bugprone-signed-char-misuse'
+    export CLANG_TIDY_PER_FILE_CHECKS='^(src|wolfcrypt)/:concurrency-mt-unsafe ^examples/:-clang-analyzer-unix.Stream,-clang-analyzer-unix.StdCLibraryFunctions ^tests/api\.c:-clang-analyzer-unix.StdCLibraryFunctions ^wolfcrypt/src/sp_(sm2_)?(arm|c|dsp|x86).*\.c:-readability-redundant-preprocessor,-bugprone-signed-char-misuse'

see also llvm/llvm-project#110551

examples/pem/pem.c: fix stdio stream leaks.

src/ssl.c and src/ssl_load.c: suppress concurrency-mt-unsafe around getenv().  getenv() is threadsafe as long as no threads putenv() or setenv().

wolfssl/openssl/asn1.h: add parentheses to fix bugprone-macro-parentheses in ASN1_EX_TEMPLATE_TYPE(), and suppress misfiring bugprone-macro-parentheses around IMPLEMENT_ASN1_FUNCTIONS().
@SparkiDev
Copy link
Copy Markdown
Contributor

retest this please

@SparkiDev SparkiDev merged commit f15700f into wolfSSL:master Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants