Skip to content

Commit c53fbb7

Browse files
Test in 32-bit mode on linux (#263)
1 parent 95e98c7 commit c53fbb7

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,35 @@ jobs:
678678
ninja
679679
./unittest_module
680680
681+
unittest-linux-32-bit:
682+
runs-on: ubuntu-24.04
683+
needs: unittest-linux
684+
strategy:
685+
fail-fast: false
686+
matrix:
687+
compiler: [g++-10, clang++-18]
688+
steps:
689+
- uses: actions/checkout@v4
690+
- name: dependencies
691+
run: |
692+
sudo apt install gcc-10 g++-10 libgcc-10-dev clang-19 clang-tools-19 ninja-build gcc-multilib g++-multilib g++-10-multilib
693+
- name: build and test
694+
run: |
695+
mkdir build
696+
cd build
697+
cmake .. \
698+
-GNinja \
699+
-DCMAKE_BUILD_TYPE=Debug \
700+
-DCMAKE_CXX_COMPILER=${{matrix.compiler}} \
701+
-DCMAKE_C_COMPILER=${{matrix.compiler == 'clang++-18' && 'clang' || 'gcc'}} \
702+
-DCPPTRACE_WERROR_BUILD=On \
703+
-DCPPTRACE_STD_FORMAT=Off \
704+
-DCPPTRACE_BUILD_TESTING=On \
705+
-DCMAKE_C_FLAGS=-m32 \
706+
-DCMAKE_CXX_FLAGS=-m32
707+
ninja
708+
./unittest_module
709+
681710
unittest-windows-32-bit:
682711
runs-on: windows-2022
683712
needs: unittest-windows

src/ctrace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ extern "C" {
342342
const auto green = use_color ? ESC "32m" : "";
343343
const auto yellow = use_color ? ESC "33m" : "";
344344
const auto blue = use_color ? ESC "34m" : "";
345-
const auto frame_number_width = cpptrace::detail::n_digits(unsigned(trace->count - 1));
345+
const auto frame_number_width = cpptrace::detail::n_digits(cpptrace::detail::to<unsigned>(trace->count - 1));
346346
ctrace_stacktrace_frame* frames = trace->frames;
347347
for(std::size_t i = 0; i < trace->count; ++i) {
348348
static constexpr auto ptr_len = 2 * sizeof(cpptrace::frame_ptr);

0 commit comments

Comments
 (0)