You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zserio version and language
Zserio: latest from master
Commit date: 6 days ago (6/4/2024 7:12:28 PM)
Commit hash: b8cc6c0
Language: C++
Describe the bug
Followup of old issue #579
Getting the bellow errors related to -Wconversion.
zserio_runtime/zserio/FloatUtil.cpp:68:33: error: conversion to 'unsigned int' from 'int' may change the sign of the result [-Werror=sign-conversion]
exponent32 = exponent16 - FLOAT16_EXPONENT_BIAS + FLOAT32_EXPONENT_BIAS;
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
zserio_runtime/zserio/BitStreamWriter.cpp:659:90: error: conversion to 'std::array<long unsigned int, 8>::size_type' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
const uint8_t add = static_cast<uint8_t>((value >> shiftBits) & bitMasks[numBits - 1]);
~~~~~~~~^~~
cc1plus: all warnings being treated as errors
How to reproduce
Steps to reproduce the behavior:
used gcc version
gcc --version
gcc (Ubuntu 8.4.0-3ubuntu2) 8.4.0
It seems to me that the reported warnings are related to the -Wsign-conversion option and not to -Wconversion option. Is it correct? Does it mean that you request to enable another -Wsign-conversion gcc option as well and investigate/fix all possible reported warnings?
Yes, you are right, reported warnings are related to the -Wsign-conversion option.
Yes, for direct integration of Zserio runtime lib without any manual adaptations,request to enable another -Wsign-conversion gcc option as well.
For zserio runtime lib only two warning instance only observed. @Roland-Homeier : FYI
mikir
changed the title
Enable conversion warnings for gcc compiler, two warnings reported
Fix all sign-conversion warnings reported by gcc compiler
Jun 12, 2024
Yes, you are right, reported warnings are related to the -Wsign-conversion option. Yes, for direct integration of Zserio runtime lib without any manual adaptations,request to enable another -Wsign-conversion gcc option as well. For zserio runtime lib only two warning instance only observed.
OK, thanks for the clarification. We will do it within the current milestone.
Please note that there is a bug till gcc version 9.3.0 which caused sign-conversion warning even if it is fixed (for more info please see the bug report).
Zserio version and language
Zserio: latest from master
Commit date: 6 days ago (6/4/2024 7:12:28 PM)
Commit hash: b8cc6c0
Language: C++
Describe the bug
Followup of old issue #579
Getting the bellow errors related to -Wconversion.
exponent32 = exponent16 - FLOAT16_EXPONENT_BIAS + FLOAT32_EXPONENT_BIAS;
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
const uint8_t add = static_cast<uint8_t>((value >> shiftBits) & bitMasks[numBits - 1]);
~~~~~~~~^~~
cc1plus: all warnings being treated as errors
How to reproduce
Steps to reproduce the behavior:
used gcc version
gcc --version
gcc (Ubuntu 8.4.0-3ubuntu2) 8.4.0
Expected behavior
No compilation warnings
@mikir Please check
The text was updated successfully, but these errors were encountered: