Closed jtilahun closed 1 year ago
maybe-uninitialized is not a perfect diagnostic, and you really shouldn't be using it in a warnings-are-errors situation. This comes up from to time, for example here -> https://stackoverflow.com/questions/51093415/why-does-this-code-trigger-gccs-maybe-uninitialized-warning
This particular compiler problem was fixed in 11.1,as you can see at https://godbolt.org/z/Pes7s47K3
So either update your compiler, or turn its broken warning off.
What version of protobuf and what language are you using? Version: v3.19.5 Language: C++
What operating system (Linux, Windows, ...) and version? Linux Ubuntu 20.04
What runtime / compiler are you using (e.g., python version or gcc version) powerpc-linux-gnuspe-gcc (Wind River VxWorks GCC 8.1.0.1 - 2019.03.13) 8.1.0
What did you do? I attempted to compile
coded_stream.cc
with the-Os
optimization level flag to optimize for size, as well as the-Wall
and-Werror
flags to enable warnings and treat all warnings as errors, respectively.What did you expect to see I expected to see the compilation to proceed successfully with no errors.
What did you see instead? I saw the compilation fail with the below errors:
Note that the errors do not appear when the
-O2
optimization level flag is used. The errors only appear when the-Os
optimization level flag is used.Anything else we should know about your project / environment Bazel v4.2.1 is used for the build system.