Grpc: Build Error: Waring level 4 and Warning treated as error fails to compile

Created on 16 Oct 2019  路  3Comments  路  Source: grpc/grpc

After running the protoc.exe which was built from source using the Ninja build instructions at https://github.com/grpc/grpc/blob/master/BUILDING.md the generated files are unable to compile with visual studio 2017 compiler when setting Warning level to 4 (/W4) and well as Treat warning as error (/WX) option enabled.

What version of gRPC and what language are you using?

I am using master from https://github.com/grpc/grpc.git at commit

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

Windows

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

Compiling with MSVC 2017 + ninja

What did you do?

protoc.exe -I ..\proto --grpc_out=output --plugin=protoc-gen-grpc=grpc_cpp_plugin.exe test.proto WorkingDirectory="src\grpc.build"

protoc.exe -I ..\proto --cpp_out=output test.proto WorkingDirectory="src\grpc.build"

What did you expect to see?

Compile cleanly in MSVC at error level 4 and treat warnings as errors turned on.

What did you see instead?

Compilation errors since treat warnings errors as and warning level 4 are specified.

arebuild dispositiostale kinbug lanother prioritP2

Most helpful comment

I would love to see these warnings resolved too. It's super messy code that's being generated, and when you actually look at the code, I start seeing items where this mixed incompatible types -- and though no actual bug is happening, it's still a warning. Warnings should be eradicated!

Or at least stick some directives into your generated code to suppress the warnings you create.
https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=vs-2019

All 3 comments

https://github.com/grpc/grpc/issues/10725 looks similar but never resolved

I would love to see these warnings resolved too. It's super messy code that's being generated, and when you actually look at the code, I start seeing items where this mixed incompatible types -- and though no actual bug is happening, it's still a warning. Warnings should be eradicated!

Or at least stick some directives into your generated code to suppress the warnings you create.
https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=vs-2019

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qiuxin picture qiuxin  路  3Comments

mlstudies picture mlstudies  路  3Comments

ericgribkoff picture ericgribkoff  路  3Comments

magick93 picture magick93  路  3Comments

jgeewax picture jgeewax  路  3Comments