Skip to content

20241015-C89-pedantic-fixes#8077

Merged
SparkiDev merged 1 commit intowolfSSL:masterfrom
douzzer:20241015-C89-pedantic-fixes
Oct 16, 2024
Merged

20241015-C89-pedantic-fixes#8077
SparkiDev merged 1 commit intowolfSSL:masterfrom
douzzer:20241015-C89-pedantic-fixes

Conversation

@douzzer
Copy link
Copy Markdown
Contributor

@douzzer douzzer commented Oct 15, 2024

clean up wolfcrypt code base for -std=c89 -pedantic: add WC_BITFIELD macro to avoid -Wpedantics for "type of bit-field ... is a GCC extension", with overrideable default definition byte, and replace parent types of all bitfields with WC_BITFIELD;

fix numerous trailing commas in enums, mostly by removing them, but one (in asn.h, enum Extensions_Sum) using WOLF_ENUM_DUMMY_LAST_ELEMENT();

rearrange bitfields in struct ed25519_key for contiguity;

always define WOLFSSL_SP_NO_DYN_STACK when defined(WOLF_C89).

tested with wolfssl-multi-test.sh ... allcryptonly-gcc-c89 with allcryptonly-gcc-c89 updated to test this configuration:

./configure --enable-sp-math-all --disable-inline --enable-cryptonly --enable-all-crypto --disable-examples --disable-crypttests --disable-benchmark CC=gcc CFLAGS="-std=c89 -pedantic -DWOLF_C89 -Wvla -Wdeclaration-after-statement -Wno-variadic-macros -DWOLFCRYPT_TEST_LINT -DWC_BITFIELD=unsigned"

also tested with wolfssl-multi-test.sh ... super-quick-check

re ZD#18760

…macro to avoid -Wpedantics for "type of bit-field ... is a GCC extension", with overrideable default definition "byte", and replace parent types of all bitfields with WC_BITFIELD;

fix numerous trailing commas in enums, mostly by removing them, but one (in asn.h, enum Extensions_Sum) using WOLF_ENUM_DUMMY_LAST_ELEMENT();

rearrange bitfields in struct ed25519_key for contiguity;

always define WOLFSSL_SP_NO_DYN_STACK when defined(WOLF_C89).
@SparkiDev SparkiDev merged commit db6a2cc into wolfSSL:master Oct 16, 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