Skip to content

Coverity static analysis warning seen on latest (v30.2) message_lite.h #21542

Open
@kmurtty

Description

@kmurtty

What version of protobuf and what language are you using?
Version: 6.30.2
Language: C++

What operating system (Linux, Windows, ...) and version?
Linux, v5.15.72, aarch64

What runtime / compiler are you using (e.g., python version or gcc version)
gcc

What did you do?

Ran Coverity static analysis of our software.

What did you expect to see

A clean Coverity run without any errors.

What did you see instead?

Coverity Static Analysis tool is complaining about the latest file “google/protobuf/message_lite.h” file. In particular, the syntax checker is complaining about the following lines of code in “message_lite.h”. The error message is saying that line number 284 is using an incomplete type.

Question: Can we safely ignore this error message? Any potential that this segment of code could lead to invalid code generation?

Following 7 lines are from “google/protobuf/message_lite.h”:

281 struct EnumTraitsImpl {
282 struct Undefined;
283 template
284 static Undefined value;
285 };
286 template
287 using EnumTraits = decltype(EnumTraitsImpl::value);

The full COVERITY warning message from our tool is as follows:

Type: Parse recovery warning (RW.INCOMPLETE_VAR_TYPE)
Classification: Unclassified
Severity: Unspecified
Action: Undecided
Owner: apotjenkins
Defect only exists locally.
/localdata/build/tmp/work/armv8a-linux/app-service/999-r0/recipe-sysroot/usr/include/google/protobuf/message_lite.h:284:3:

  1. incomplete_var_type: variable cannot have incomplete type "google::protobuf::internal::EnumTraitsImpl::Undefined"

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment

We are using gRPC Library version 1.71.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions