Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compile error when upgrading to 3.1.19 #17700

@nathan-stouffer-onx

Description

@nathan-stouffer-onx

We are using emscripten to build google's protobuf library. When we upgraded our emsdk from version 3.1.18 to 3.1.19, we now get the following compile error that we didn't get before.

/usr/local/var/vcpkg/buildtrees/protobuf/src/23fa7edd52-3ba2225d30.clean/src/google/protobuf/wire_format_lite.cc:102:9:
error: integer value -1 is outside the valid range of values [0, 7] for this enumeration type [-Wenum-constexpr-conversion]
    static_cast<WireFormatLite::WireType>(-1),  // invalid         
1 error generated.

Here is the link to the offending line of source code and it's definition: https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/wire_format_lite.cc#L104
https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/wire_format_lite.h#L104

My first thought is that something with SWIG changed and the WireType enum is no longer defined as an int, but an unsigned int. But I don't really know what SWIG is or why it is there.

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.19 (a5f7b1c9a1c74a830bebedc122d204800ce8dff9)
clang version 16.0.0 (https://github.com/llvm/llvm-project 30171e76f0e5ea8037bc4d1450dd3e12af4d9938)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /usr/local/var/emsdk/upstream/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions