Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings from parser are dropped on the floor #9343

Closed
benesch opened this issue Dec 25, 2021 · 0 comments · Fixed by #9344
Closed

Warnings from parser are dropped on the floor #9343

benesch opened this issue Dec 25, 2021 · 0 comments · Fixed by #9344
Assignees
Labels

Comments

@benesch
Copy link
Contributor

benesch commented Dec 25, 2021

What version of protobuf and what language are you using?
Version: master
Language: n/a

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

macOS 12.0 (but not applicable)

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

n/a

What did you do?

Invoked protoc --descriptor_set_out=/dev/null bad.proto on this input:

// bad.proto
message bad_to_the_bone {}

What did you expect to see

This warning about snake case names:

"Message name should be in UpperCamelCase. Found: " +
message->name() +
". See https://developers.google.com/protocol-buffers/docs/style");

What did you see instead?

Nothing.

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

benesch added a commit to benesch/protobuf that referenced this issue Apr 17, 2022
acozzette added a commit that referenced this issue May 13, 2022
* Don't drop parser warnings on the floor

Fix #9343.

* Convert "missing syntax" warning to an actual warning

For some reason this warning was emitted as a log message rather than a
structured warning. Convert it to use the AddWarning API so that it gets
emitted with a file and line number by protoc, and is visible via the
error collection interface during programmatic use.

* Remove CaptureTestStderr() call

CaptureTestStderr() and GetCapturedTestStderr() have to be paired with each other.

* Adjust tests for new warnings

A few tests now produce warnings that they didn't before, but were
expecting not to see any stderr output. Adjust the tests accordingly.

Co-authored-by: Adam Cozzette <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants