Skip to content

Fix test build error on arm - #1513

Open
DDoSolitary wants to merge 1 commit into
jbeder:masterfrom
DDoSolitary:fix-clang-arm-test-build
Open

DDoSolitary wants to merge 1 commit into
jbeder:masterfrom
DDoSolitary:fix-clang-arm-test-build

Conversation

@DDoSolitary

@DDoSolitary DDoSolitary commented Oct 21, 2026 •

Copy link
Copy Markdown

On arm char is unsigned and and narrowing conversion in list initialization is strictly ill-formed in c++

Error:

/home/ddosolitary/yaml-cpp/test/binary_test.cpp:11:21: error: constant expression evaluates to -58 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
   11 |   std::string input{-58, -1, -99, 109};
      |                     ^~~
/home/ddosolitary/yaml-cpp/test/binary_test.cpp:11:21: note: insert an explicit cast to silence this issue
   11 |   std::string input{-58, -1, -99, 109};
      |                     ^~~
      |                     static_cast<char>( )
/home/ddosolitary/yaml-cpp/test/binary_test.cpp:11:26: error: constant expression evaluates to -1 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
   11 |   std::string input{-58, -1, -99, 109};
      |                          ^~
/home/ddosolitary/yaml-cpp/test/binary_test.cpp:11:26: note: insert an explicit cast to silence this issue
   11 |   std::string input{-58, -1, -99, 109};
      |                          ^~
      |                          static_cast<char>( )
/home/ddosolitary/yaml-cpp/test/binary_test.cpp:11:30: error: constant expression evaluates to -99 which cannot be narrowed to type 'char' [-Wc++11-narrowing]
   11 |   std::string input{-58, -1, -99, 109};
      |                              ^~~
/home/ddosolitary/yaml-cpp/test/binary_test.cpp:11:30: note: insert an explicit cast to silence this issue
   11 |   std::string input{-58, -1, -99, 109};
      |                              ^~~
      |                              static_cast<char>( )
3 errors generated.

Minimal reproducer: https://godbolt.org/z/rE5cGsWKM

@DDoSolitary DDoSolitary changed the title Fix test build error on arm clang Fix test build error on arm Oct 21, 2026
On arm char is unsigned and narrowing conversion from signed value
during list-initialization is strictly ill-formed.
@DDoSolitary
DDoSolitary force-pushed the fix-clang-arm-test-build branch from 867a7b9 to b580845 Compare October 21, 2026 15:43
DDoSolitary added a commit to DDoSolitary/ld-audit-search-mod that referenced this pull request Oct 21, 2026
Also enable continue-on-error for the failing arm build due to char
being unsigned on arm. It was not caught earlier because nixpkgs enabled
YAML_CPP_BUILD_TESTS only recently.

jbeder/yaml-cpp#1513
DDoSolitary added a commit to DDoSolitary/ld-audit-search-mod that referenced this pull request Oct 21, 2026
Also enable continue-on-error for the failing arm build due to char
being unsigned on arm. It was not caught earlier because nixpkgs enabled
YAML_CPP_BUILD_TESTS only recently.

jbeder/yaml-cpp#1513
bob-beck pushed a commit to openbsd/ports that referenced this pull request Oct 26, 2026
Spotted on arm64. Issue mentioned in
jbeder/yaml-cpp#1513 but instead of adding
a patch let's see what upstream thinks.

ok tb

This branch has not been deployed

No deployments
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