-
Notifications
You must be signed in to change notification settings - Fork 921
Avoid flexible arrays on unsupported platforms via a macro. #7538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| #pragma warning(disable: 4200) | ||
| #endif | ||
| byte hashSigAlgo[]; /* sig/algo to offer */ | ||
| byte hashSigAlgo[WOLFSSL_FLEXIBLE_ARRAY_SIZE]; /* sig/algo to offer */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clang-tidy-defaults] [7 of 7] [ac3063c1e8]
configure... real 0m18.881s user 0m5.668s sys 0m2.801s
build..../wolfssl/internal.h:3178:29: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
byte hashSigAlgo[WOLFSSL_FLEXIBLE_ARRAY_SIZE]; /* sig/algo to offer */
^
/tmp/workspace/PRB-multi-test-script/wolfssl/./wolfssl/wolfcrypt/wc_port.h:1276:41: note: expanded from macro 'WOLFSSL_FLEXIBLE_ARRAY_SIZE'
#define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0
^
./wolfssl/internal.h:3356:17: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
byte data[WOLFSSL_FLEXIBLE_ARRAY_SIZE];
^
/tmp/workspace/PRB-multi-test-script/wolfssl/./wolfssl/wolfcrypt/wc_port.h:1276:41: note: expanded from macro 'WOLFSSL_FLEXIBLE_ARRAY_SIZE'
#define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0
^
./wolfssl/internal.h:5216:14: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
byte buf[WOLFSSL_FLEXIBLE_ARRAY_SIZE];
^
/tmp/workspace/PRB-multi-test-script/wolfssl/./wolfssl/wolfcrypt/wc_port.h:1276:41: note: expanded from macro 'WOLFSSL_FLEXIBLE_ARRAY_SIZE'
#define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0
^
make[2]: *** [Makefile:7277: wolfcrypt/src/src_libwolfssl_la-asn.lo] Error 1
make[1]: *** [Makefile:8414: all-recursive] Error 1
make: *** [Makefile:5059: all] Error 2
real 2m34.598s user 2m0.813s sys 0m2.866s
clang-tidy-defaults fail_analytic_build
failed config: 'CPPFLAGS=-DKEEP_OUR_CERT -DKEEP_PEER_CERT -DWOLFSSL_ALT_NAMES -DNO_WOLFSSL_CIPHER_SUITE_TEST -DWOLFSSL_OLD_PRIME_CHECK -pedantic -DSP_ALLOC -DWOLFSSL_CLANG_TIDY' 'CC=/tmp/workspace/PRB-multi-test-script/testing/git-hooks/clang-tidy-builder.sh' 'CLANG=/usr/lib/llvm-14/bin/clang-14' 'CFLAGS=-Wunreachable-code-aggressive -Wthread-safety -Wloop-analysis -Wenum-compare-conditional -fcolor-diagnostics -fcomplete-member-pointers -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -g -fdebug-types-section -Wunreachable-code-break -Wunreachable-code-return -Wimplicit-fallthrough'
final tally: 6 of 7 checks succeeded, 0 skipped, 0 forced, and 1 failed, for ac3063c1e8.
exiting with status 2
d4da6f8 to
f4293d9
Compare
douzzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync with latest from wolfSentry.
wolfssl/wolfcrypt/wc_port.h
Outdated
| #if defined(__STRICT_ANSI__) | ||
| #define WOLFSSL_FLEXIBLE_ARRAY_SIZE 1 | ||
| #elif defined(__GNUC__) | ||
| #define WOLFSSL_FLEXIBLE_ARRAY_SIZE | ||
| /*!< \brief Value appropriate as a size for an array that will be allocated to a variable size. Built-in value usually works. */ | ||
| #else | ||
| #define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0 | ||
| #endif | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest setup from wolfSentry has more subtleties.
Thanks to wolfSentry for the logic.
498c63f to
b399fd4
Compare
Description
Fixes zd#17977
Credit to wolfSentry for the fix
Customer to confirm fix, please do not merge before then
Testing
Built in tests with --enable-dtlscid --enable-tls13 --enable-tlsx --enable-dtls13 --enable-dtls which should cover all cases
Checklist