Skip to content

Fix build on targets where int32_t is not int (LIST_VALUE) - #165

Open
jerrytron wants to merge 1 commit into
JBenda:masterfrom
choosatron:fix/int32-portability-list-value
Open

Fix build on targets where int32_t is not int (LIST_VALUE)#165
jerrytron wants to merge 1 commit into
JBenda:masterfrom
choosatron:fix/int32-portability-list-value

Conversation

@jerrytron

Copy link
Copy Markdown

value::set<value_type::int32> is specialized on int32_t, and int32_t is not int on every target — on Xtensa (ESP32) it is long.

The four LIST_VALUE call sites added in #162 pass a bare 0 and the int returned by get_flag_value(), so on those platforms overload resolution selects the primary template rather than the specialization and the build stops:

value.h:132: error: static assertion failed: No setter for this type defined!
    required from list_operations.h:254

It compiles on x86-64 and arm64 Linux/macOS, where int32_t is int, which is why CI did not catch it.

Every other set<value_type::int32> call site in the tree already converts explicitly — numeric_operations.h, container_operations.cpp, runner_impl.cpp — so this just follows the existing convention rather than introducing one.

Found building for ESP32-S3. ctest passes.

value::set<value_type::int32> is specialized on int32_t, and int32_t is
not int on every target: on Xtensa it is long. So set<int32>(0) and
set<int32>(get_flag_value(...)), which returns int, select the primary
template on those platforms rather than the specialization, and the
build stops on

    static assertion failed: No setter for this type defined!

It compiles on x86-64 and arm64 Linux/macOS, where int32_t is int, so
the four call sites added with LIST_VALUE went unnoticed.

Every other set<value_type::int32> call site in the tree already casts
explicitly - numeric_operations.h, container_operations.cpp,
runner_impl.cpp - so this just follows the existing convention.

Found building for ESP32-S3.

Co-Authored-By: Claude Opus 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.

1 participant