Skip to content

Phase 5: enforce -Werror on our code across the full CI matrix - #4

Merged
tap merged 4 commits into
masterfrom
claude/rtaudio-werror-hardening
Jun 23, 2026
Merged

Phase 5: enforce -Werror on our code across the full CI matrix#4
tap merged 4 commits into
masterfrom
claude/rtaudio-werror-hardening

Conversation

@tap

@tap tap commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Overview

Phase 5 (final hardening pass, follows merged #1/#2/#3): turn -Werror on for our code across the entire CI matrix, not just the portable core. Tracked in AUDIT.md.

All 16 CI jobs pass with the gate enabled.

What changed

  • CI-Werror is now enforced on the Linux (ALSA/Pulse/JACK/OSS) and macOS (CoreAudio) CMake builds (RTAUDIO_WARNINGS_AS_ERRORS=ON) and the MinGW WASAPI/DirectSound builds (CXXFLAGS=-Werror). These configs compile only our code. MinGW ASIO is intentionally left non--Werror because it also compiles the vendored Steinberg ASIO SDK sources, which we don't own.
  • -Wvla added to the GCC/Clang warning flags so variable-length arrays are rejected on every compiler (GCC doesn't flag them under -Wall/-Wextra; Clang does).
  • VLA fixes — enabling the gate surfaced only four pre-existing issues, all VLAs (the backends were otherwise clean under -Wall -Wextra):
    • CoreAudio probeDevices/probeDeviceInfo: AudioDeviceID ids[nDevices], AudioValueRange rangeList[nRanges]std::vector.
    • ALSA callbackEvent: void *bufs[channels] (read + write paths) → std::vector.

Net effect

Combined with the portable StrictWarnings job from #1, the fork now builds all of its own code warning-clean under -Wall -Wextra -Wvla -Werror on GCC and Clang across Linux, macOS, and Windows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WHbT36gMxx7WH2tzZfiqUt


Generated by Claude Code

claude added 4 commits June 23, 2026 11:54
Turns the warning gate on for the backend builds, not just the portable
core: the Linux (ALSA/Pulse/JACK/OSS) and macOS (CoreAudio) CMake builds
now pass -DRTAUDIO_WARNINGS_AS_ERRORS=ON, and the MinGW WASAPI/DirectSound
builds pass CXXFLAGS=-Werror. These configurations compile only our code
(RtAudio.cpp / rtaudio_c.cpp).

MinGW ASIO is intentionally left non-fatal because it also compiles the
vendored Steinberg ASIO SDK sources, which we do not own.

This commit may surface pre-existing -Wextra warnings in the backends;
those are fixed in the following commits.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHbT36gMxx7WH2tzZfiqUt
With -Werror enabled on the macOS CoreAudio build, Clang flagged two
variable-length arrays (-Wvla-cxx-extension) in RtApiCore:

  AudioDeviceID ids[ nDevices ];          (probeDevices)
  AudioValueRange rangeList[ nRanges ];   (probeDeviceInfo)

VLAs are non-portable (rejected by MSVC and a Clang/GCC extension in
C++). Both are now std::vector, passing .data() to
AudioObjectGetPropertyData.

Also add -Wvla to the GCC/Clang warning flags so the Linux/Windows
builds (GCC does not warn on VLAs under -Wall/-Wextra) guard against
future VLAs too.

The Linux (ALSA/Pulse/JACK/OSS) and MinGW WASAPI/DirectSound builds
already passed -Werror; this was the only backend with findings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHbT36gMxx7WH2tzZfiqUt
The newly-added -Wvla flag made GCC flag two variable-length arrays in
RtApiAlsa::callbackEvent for the non-interleaved path:

  void *bufs[channels];   // input (snd_pcm_readn) and output (snd_pcm_writen)

Both are now std::vector<void *>, passing .data() to the snd_pcm_*n
calls. This confirms -Wvla is doing its job: GCC does not flag VLAs under
-Wall/-Wextra, so these were previously invisible on the Linux builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHbT36gMxx7WH2tzZfiqUt
Records that warnings-as-errors is now enforced on our code on every
platform (Linux/macOS via CMake, MinGW WASAPI/DS via CXXFLAGS), the
added -Wvla flag, the four VLAs it surfaced (now fixed), and the ASIO
exception. Also removes a stray duplicate section header.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHbT36gMxx7WH2tzZfiqUt
@tap
tap merged commit 1e85aa7 into master Jun 23, 2026
32 checks passed
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