QPCPP 8.1.1 build errors with -Wsign-conversion
Real-Time Event Frameworks based on active objects & state machines
Brought to you by:
quantum-leaps
Attempting to update to qpcpp 8.1.1 from 8.0.4, getting the following error at multiple locations:
cpputest-for-qpcpp/externals/qpcpp/src/qf/qep_msm.cpp: In member function ‘QP::QState QP::QMsm::enterHistory_(const QP::QMState*, uint_fast8_t)’:
/home/eshlemanm/cpputest-for-qpcpp/externals/qpcpp/src/qf/qep_msm.cpp:359:18: error: conversion to ‘std::array<const QP::QMState*, 6>::size_type’ {aka ‘long unsigned int’} from ‘int_fast8_t’ {aka ‘signed char’} may change the sign of the result [-Werror=sign-conversion]
359 | path[i] = s;
i.e. basically all the code using a signed int for indexing into arrays that have been changed to std::array<> types, which enforces unsigned int indexing.
Context:
https://github.com/covemountainsoftware/cpputest-for-qpcpp
-Wall -Wextra -Werror -Wpedantic -Wold-style-cast -Wsign-conversion
Ubuntu 24.04: gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)
Anonymous