Skip to content

Ignore -Wnested-anon-types when using Clang #1245

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
wants to merge 1 commit into from
Closed

Ignore -Wnested-anon-types when using Clang #1245

wants to merge 1 commit into from

Conversation

Psirus
Copy link

@Psirus Psirus commented Jan 11, 2018

As it says in the title, this change will add the -Wnested-anon-types to the list of ignored warning flags under Clang. Solves #1204.

@jagerman
Copy link
Member

In this case I think it might be cleaner to listen to the warning rather than ignoring it, i.e. by adding:

struct nonsimple_values_and_holders {
    void **values_and_holders;
    uint8_t *status;
};

just before struct instance { in detail/common.h, then using it in the union by changing the union from:

    union {
        void *simple_value_holder[1 + instance_simple_holder_in_ptrs()];
        struct { /* ... */ } nonsimple;
    };

to:

    union {
        void *simple_value_holder[1 + instance_simple_holder_in_ptrs()];
        nonsimple_values_and_holders nonsimple;
    };

(Assuming that's the only thing raising this warning, of course).

@Psirus
Copy link
Author

Psirus commented Jan 11, 2018

Fine by me, it's just that most of the pybind code is way over my head and I didn't want to break anything.

@Psirus
Copy link
Author

Psirus commented Jan 11, 2018

Solved in an improved way in #1248.

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