release: v0.5.5#170
Merged
Merged
Conversation
User code that includes the strucpp runtime through a generated
`c_blocks_code.cpp` (openplc-editor's Arduino flow) compiles under
whatever `-std=` the platform's Arduino core picked. Most cores use
gnu++17 or later, but **every mbed-based Arduino core** — `mbed_nano`
(Nano RP2040 Connect, Nano 33 BLE), `mbed_opta` (Opta), `mbed_giga`
(GIGA), `mbed_portenta`, `mbed_edge` — hard-codes `-std=gnu++14` in
its `cxxflags.txt`. On those targets every C/C++ POU compile fails
with a cascade of `'is_convertible_v' is not a member of 'std'` etc.
out of `iec_var.hpp` / `iec_string.hpp` / `iec_traits.hpp`.
The strucpp runtime tests + the precompile stage of the openplc
build keep using C++17, so this commit doesn't downgrade anything
there — it just removes incidental C++17 usage from the four headers
reachable from `c_blocks_code.cpp`'s transitive include chain.
Substitutions (purely syntactic, no semantic change):
iec_var.hpp:
- `std::is_X_v<T>` (×8) → `std::is_X<T>::value`
iec_string.hpp:
- `std::is_X_v<T>` (×3) → `std::is_X<T>::value`
- `TO_STRING(integral)` rewritten from `if constexpr` (C++17) into
two SFINAE'd overloads (signed vs unsigned). Same behaviour;
tag-dispatch is C++11-clean.
iec_traits.hpp:
- `std::is_X_v<T>` (×3) → `std::is_X<T>::value`
- `std::bool_constant<X>` (×2) → `std::integral_constant<bool, X>`
- `template<typename B, auto L, auto U>` (×4) → typed bounds
`template<typename B, B L, B U>` (subrange specs + forward decls)
- 14 `inline constexpr ...` variable templates → `constexpr ...`
(inline variables are C++17; variable templates without `inline`
are C++14 and work for header-only metaprogramming where the
address is never taken)
iec_subrange.hpp:
- Primary `IEC_SUBRANGE_Value` / `IEC_SUBRANGE_Var` template heads
and the matching `IEC_SUBRANGE` alias switched from `auto Lower,
auto Upper` to `BaseType Lower, BaseType Upper`. IEC subrange
bounds are always the base type by the standard, so this is no
capability loss and keeps the declaration consistent with the
forward decls in `iec_traits.hpp`.
ABI verification: compiled the headers under both `-std=gnu++14` and
`-std=gnu++17` against a c_blocks_code.cpp-equivalent translation
unit; both produce byte-identical 2552-byte `.o` files.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-bridge fix(runtime): make user-facing headers compile under gnu++14 (mbed cores)
Patch release: fix(runtime): make user-facing headers compile under gnu++14 so c_blocks_code.cpp builds under mbed-based Arduino cores (Nano RP2040 Connect, Opta, Nano 33 BLE, GIGA, Portenta, Edge Control). See #168. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore(release): v0.5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
iec_var.hpp,iec_string.hpp,iec_traits.hpp,iec_subrange.hpp) verified to compile under both gnu++14 and gnu++17, byte-identical .o output