Skip to content

fix: C++17 compatibility — atomic<bool> stop, shadow fix, PID test vector#1

Merged
SoundMatt merged 3 commits into
mainfrom
feat/fix-cpp17-compat
Jun 19, 2026
Merged

fix: C++17 compatibility — atomic<bool> stop, shadow fix, PID test vector#1
SoundMatt merged 3 commits into
mainfrom
feat/fix-cpp17-compat

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

  • Replace std::stop_token/std::stop_source (C++20) with std::atomic<bool> in lin::master::Node::run() — header, implementation, and all tests — so the library builds cleanly under -std=c++17
  • Fix -Wshadow warning in src/lin.cpp: lambda init-capture frames = std::move(frames) renamed to frame_ch to avoid shadowing the outer structured binding
  • Correct wrong protect_id test vector: ID=0x10 has bit4=1, so P0=1, PID=0x50 (not 0x10 as the comment incorrectly stated)

Test plan

  • cmake -B build -G "Unix Makefiles" — configures clean under AppleClang 21 / C++17
  • cmake --build build — zero errors, zero warnings
  • ctest --output-on-failure — 160/160 tests pass
  • CI: build matrix (GCC + Clang), sanitizers (ASan + UBSan), coverage ≥70%, relay-conform, cpfusa ASIL-B

Requirements traceability

REQ-MASTER-001..013 — all master node requirements remain covered

…vector

Replace std::stop_token/std::stop_source (C++20) with std::atomic<bool>
in master node header, implementation and tests so the library builds
clean under -std=c++17. Fix a variable-shadow warning in the RELAY
adapter lambda capture and correct a wrong PID test vector for ID=0x10
(P0 = ID0^ID1^ID2^ID4 = 1, so PID = 0x50, not 0x10).

Signed-off-by: Matt Jones <matt@jellybaby.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
CTest passes test names as regex filters on Windows; the Unicode right
arrow (U+2192) in the crc16 test name was silently replaced with '?'
causing the filter to match nothing and the test to be reported as
failed (no tests ran). Replace with ASCII '->'.

Signed-off-by: Matt Jones <matt@jellybaby.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

…orter arg

The docker build step was looking for Dockerfile in repo root but it
lives at docker/Dockerfile. Add -f flag to point at the correct path.
Also remove --reporter compact from docker run; that is a Catch2 flag,
not a ctest flag, and the container ENTRYPOINT is ctest.

Signed-off-by: Matt Jones <matt@jellybaby.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt SoundMatt merged commit fc1c046 into main Jun 19, 2026
14 checks passed
@SoundMatt SoundMatt deleted the feat/fix-cpp17-compat branch June 19, 2026 20:04
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