Skip to content

New warning: missing braces around initializer [-Wmissing-braces] #115441

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

Closed
Eclips4 opened this issue Feb 14, 2024 · 3 comments
Closed

New warning: missing braces around initializer [-Wmissing-braces] #115441

Eclips4 opened this issue Feb 14, 2024 · 3 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Feb 14, 2024

Bug report

Bug description:

Popped up in https://github.com/python/cpython/pull/115440/files

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@Eclips4 Eclips4 added the type-bug An unexpected behavior, bug, or error label Feb 14, 2024
@colesbury
Copy link
Contributor

I think the warning started in #115329. It occurs in the non-debug default build.

My guess is that the GCC doesn't like the definition of _py_object_state_INIT() anymore:

# define _py_object_state_INIT(INTERP) \
{ 0 }

cc @corona10

@colesbury
Copy link
Contributor

We can just remove _py_object_state_INIT completely and not explicitly initialize .object_state. Zero initialization is fine for that field.

colesbury added a commit to colesbury/cpython that referenced this issue Feb 14, 2024
Removes `_py_object_state_INIT`. We want to initialize the
"object_state" field to zero.
colesbury added a commit that referenced this issue Feb 14, 2024
Removes `_py_object_state_INIT`. We want to initialize the `object_state` field to zero.
@Eclips4
Copy link
Member Author

Eclips4 commented Feb 14, 2024

Thanks Sam for fixing!

@Eclips4 Eclips4 closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants