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

Avoid a 'may be used uninitialized' warning when built with '-c opt'. #15846

Closed
wants to merge 1 commit into from

Conversation

bcsgh
Copy link
Contributor

@bcsgh bcsgh commented Feb 15, 2024

The motivation for this is first that under some combinations of flags it breaks builds and second it's trivial (and possibly zero runtime cost) to fix.

It looks like the possibly bad case "should never happen", but converting this to a null pointer in the error case (which should at least make the failure less problematic) is cheap.

…(that could result in a non-null garbage pointer).
@bcsgh bcsgh marked this pull request as ready for review February 15, 2024 01:00
@bcsgh
Copy link
Contributor Author

bcsgh commented Feb 15, 2024

Because the CI refuses to run (and refuses to tell me what to do about that #15847) I have no idea if this is ready for review yet so I'll just kick it out and see what happens.

@bcsgh bcsgh requested a review from a team as a code owner February 15, 2024 01:01
@bcsgh bcsgh requested review from fowles and removed request for a team February 15, 2024 01:01
@fowles fowles added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Feb 15, 2024
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Feb 15, 2024
@bcsgh
Copy link
Contributor Author

bcsgh commented Feb 15, 2024

@fowles so which presubmit did I break internally?

@fowles
Copy link
Contributor

fowles commented Feb 15, 2024

@fowles so which presubmit did I break internally?

It got hung up on something silly and I had to give it kick. Hopefully it goes through smoothly in the next couple hours.

@bcsgh bcsgh deleted the bcsgh/uninitialized branch February 17, 2024 23:01
deannagarcia pushed a commit to deannagarcia/protobuf that referenced this pull request Jun 20, 2024
…protocolbuffers#15846)

The motivation for this is first that under some combinations of flags it breaks builds and second it's trivial (and possibly zero runtime cost) to fix.

It looks like the possibly bad case "should never happen", but converting this to a null pointer in the error case (which should at least make the failure less problematic) is cheap.

Closes protocolbuffers#15846

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#15846 from bcsgh:bcsgh/uninitialized 321d649
PiperOrigin-RevId: 607404168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants