Skip to content

Enforce C99 and wolfSSL coding standards - #19

Open
aidangarske wants to merge 4 commits into
wolfSSL:mainfrom
aidangarske:ci/c99-wolfssl-standards
Open

aidangarske wants to merge 4 commits into
wolfSSL:mainfrom
aidangarske:ci/c99-wolfssl-standards

Conversation

@aidangarske

@aidangarske aidangarske commented Sep 22, 2026

Copy link
Copy Markdown
Member
  • Add strict C99 compiler probes and a GCC/Clang host-suite CI matrix.
  • Enforce no goto and no standalone brace scopes in project C while preserving existing section banners.
  • Replace C11 static assertions with C99-compatible checks and document platform qualification boundaries.

Copilot AI lite review requested due to automatic review settings September 22, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Five unresolved moderate findings leave dependency flags, VLA enforcement, style scanning, firmware flags, and generated-code checks incomplete.

Review effort: Lite
Findings: None

What changed in this PR

This pull request standardizes wolfTrust C builds on C99 and adds compiler, style, scope, and CI validation across host tests, firmware, and dependencies.

Changes:

  • Adds C99 probes, compiler flags, host-suite coverage, and GCC/Clang CI.
  • Replaces C11 assertions and prohibited goto/standalone scopes.
  • Updates build files, documentation, and coding-standard checks.
File Reviewed change
tests/​host/​wolfhsm_relay/​user_settings.h Updates C99 documentation.
tests/​host/​wolfhsm_relay/​stubs/​zephyr/​logging/​log.h Updates the logging stub for C99-compatible use.
tests/​host/​wolfhsm_loopback/​user_settings.h Updates C99 documentation.
tests/​host/​vnet/​test_pool.c Removes a standalone scope.
tests/​host/​vnet_relay/​Makefile Uses C99 compilation.
tests/​host/​vault_service/​Makefile Uses C99 compilation.
tests/​host/​storage_service/​Makefile Uses C99 compilation.
tests/​host/​spm/​Makefile Uses C99 compilation.
tests/​host/​spm_gate/​Makefile Uses C99 compilation.
tests/​host/​sp_recovery/​Makefile Uses C99 compilation.
tests/​host/​sp_layout/​Makefile Adds an include path and C99 flags.
tests/​host/​sp_layout/​main.c Replaces static assertions.
tests/​host/​runtime_verify/​Makefile Uses C99 compilation.
tests/​host/​rollback/​Makefile Uses C99 compilation.
tests/​host/​qcbor_shim/​user_settings.h Updates C99 documentation.
tests/​host/​qcbor_shim/​Makefile Uses C99 compilation.
tests/​host/​qcbor_shim/​main.c Removes a standalone scope.
tests/​host/​psa_storage_client/​Makefile Uses C99 compilation.
tests/​host/​psa_headers/​Makefile Uses C99 compilation.
tests/​host/​psa_headers/​main.c Replaces static assertions.
tests/​host/​psa_ffm_client/​Makefile Uses C99 compilation.
tests/​host/​psa_ffm_client/​main.c Replaces a static assertion.
tests/​host/​psa_ff_upstream/​Makefile Uses C99 and forwards extra flags.
tests/​host/​ps_service/​Makefile Uses C99 compilation.
tests/​host/​port_binding/​Makefile Uses C99 compilation.
tests/​host/​negatives/​user_settings.h Updates C99 documentation.
tests/​host/​negatives/​Makefile Uses C99 compilation.
tests/​host/​manifest/​test_generator.py Compiles generated code as C99. moderate (1 vote): Its hard-coded compiler command omits -Werror=vla and EXTRA_CFLAGS, allowing VLAs through make c99-check.
tests/​host/​manifest/​Makefile Uses C99 compilation.
tests/​host/​Makefile Propagates C99 flags. moderate (1 vote): -pedantic-errors remains enabled for wolfCOSE sources because dependency flags filter only exact -pedantic and -Werror tokens.
tests/​host/​lifecycle/​Makefile Uses C99 compilation.
tests/​host/​keystore_isolation/​user_settings.h Updates C99 documentation.
tests/​host/​ipc/​Makefile Uses C99 compilation.
tests/​host/​guest_verify/​Makefile Uses C99 compilation.
tests/​host/​fwu_service/​Makefile Uses C99 compilation.
tests/​host/​flash_nvm/​Makefile Uses C99 compilation.
tests/​host/​ffm/​Makefile Uses C99 compilation.
tests/​host/​ffm_veneer/​Makefile Uses C99 compilation.
tests/​host/​ffm_domain/​Makefile Uses C99 compilation.
tests/​host/​domain/​Makefile Uses C99 compilation.
tests/​host/​boot_handoff/​Makefile Uses C99 compilation.
tests/​host/​boot_handoff/​main.c Replaces static assertions.
tests/​host/​attestation/​user_settings.h Updates C99 documentation.
tests/​host/​attestation/​Makefile Uses C99 compilation.
tests/​host/​attestation_token/​user_settings.h Updates C99 documentation.
tests/​host/​attestation_token/​Makefile Uses C99 compilation.
tests/​host/​attestation_service/​Makefile Uses C99 compilation.
tests/​host/​attestation_replay/​user_settings.h Updates C99 documentation.
tests/​host/​attestation_replay/​Makefile Uses C99 compilation.
tests/​host/​attestation_negatives/​user_settings.h Updates C99 documentation.
tests/​host/​attestation_negatives/​Makefile Uses C99 compilation.
tests/​host/​attestation_iak/​user_settings.h Updates C99 documentation.
tests/​host/​attestation_golden/​user_settings.h Updates C99 documentation.
tests/​host/​attestation_golden/​Makefile Uses C99 compilation.
tests/​fuzz/​Makefile Uses C99 compilation.
tests/​firmware/​zephyr-stm32h5/​apps/​freertos_guest1/​main.c Removes goto control flow.
tests/​firmware/​stm32h563/​Makefile Uses C99 firmware flags. moderate (1 vote): The default WT_ENGINE_HSM=1 path omits shared C99 and VLA flags from the effective secure and nonsecure compiler flags.
tests/​firmware/​stm32h563-vnet/​nonsecure/​guest.c Removes standalone scopes.
tests/​firmware/​stm32h563-vnet/​Makefile Uses C99 guest flags.
tests/​c99/​valid.c Adds a valid C99 probe.
tests/​c99/​invalid_vla.c Adds a VLA rejection probe.
tests/​c99/​invalid_c11.c Adds a C11 syntax rejection probe.
tests/​c99/​check.sh Runs compiler compliance checks.
src/​services/​wolfhsm/​wt_hsm.c Replaces a static assertion.
src/​services/​wolfhsm/​runner/​user_settings.h Enables required dependency ABI support.
src/​arch/​armv8m/​guest_context_armv8m.c Replaces layout assertions.
src/​arch/​armv8m/​coroutine_armv8m.c Replaces layout assertions.
scripts/​check-empty-brace-scopes.py Detects standalone C scopes.
scripts/​check_house_style.sh Adds house-style checks. moderate (1 vote): The URL exemption filters whole lines, allowing a forbidden // comment on a line containing an allowed URL.
mk/​common.mk Adds secure-build C99 flags. moderate (1 vote): -Werror=vla is limited to the host-only gate, so secure image, firmware, and fuzz builds can still accept VLAs.
Makefile Adds the C99 check target.
include/​wolftrust/​static_assert.h Provides C99-compatible assertions.
docs/​Coding-Standard.md Documents coding requirements.
docs/​_Sidebar.md Links the coding standard.
.github/​workflows/​README.md Documents new CI gates.
.github/​workflows/​house-style.yml Runs house-style checks.
.github/​workflows/​empty-brace-scan.yml Runs scope scanning.
.github/​workflows/​c99-compliance.yml Runs GCC and Clang C99 checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@aidangarske aidangarske reopened this Sep 22, 2026
@aidangarske
aidangarske force-pushed the ci/c99-wolfssl-standards branch from d6954e6 to ccf3800 Compare September 22, 2026 21:12

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #19

Scan targets checked: wolftrust-src, wolftrust-bugs

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

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.

4 participants