Skip to content

Tests: rename B0/B1 locals that collide with termios macros - #206

Open
ladnir wants to merge 1 commit into
masterfrom
fix-termios-b0b1
Open

ladnir wants to merge 1 commit into
masterfrom
fix-termios-b0b1

Conversation

@ladnir

@ladnir ladnir commented Nov 24, 2026

Copy link
Copy Markdown
Member

Fixes #186.

On Linux, Boost.Asio's serial port support includes <termios.h>, which defines the baud rates B0, B1, ... as macros. With ENABLE_BOOST=ON, local variables with those names in BinarySolver_Tests.cpp and RingLpn_Tests.cpp stopped libOTe_Tests from compiling. This renames them to Bsh0/Bsh1. Nothing else in the tree uses those names as identifiers.

Validation

GCC on Linux, with <termios.h> force-included into every file (-DCMAKE_CXX_FLAGS=--include=termios.h). This is the same header Boost.Asio pulls in, so it reproduces the bug without building Boost. The build used ENABLE_ALL_OT, both DPF options and ENABLE_RINGLPN.

  • With this change, the full build succeeds and -u RingLpn passes (9 tests). This also shows that no other identifier in the tree collides with a termios macro.
  • With the original RingLpn_Tests.cpp, the build fails at the old B0 line with the error reported in the issue.

CI still doesn't build with Boost on Linux, so it can't catch a recurrence. Adding the flag above to a Linux job would.

🤖 Generated with Claude Code

On Linux, Boost.Asio's serial port support includes <termios.h>, which
defines B0, B1, ... as baud-rate macros. With ENABLE_BOOST=ON the
BinarySolver and RingLpn tests failed to compile. Rename the locals to
Bsh0/Bsh1.

Fixes #186

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Test files use variable names B0/B1 that collide with termios macros (recurrence of #172)

1 participant