Skip to content

"anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]" #1204

Closed
@anntzer

Description

@anntzer

Issue description

Compiling a file that includes pybind11/detail/common.h (it is private but obviously included by other public headers) with clang -Wpedantic triggers the warning

In file included from src/main.cpp:1:
In file included from /usr/include/python3.6m/pybind11/pybind11.h:43:
In file included from /usr/include/python3.6m/pybind11/attr.h:13:
In file included from /usr/include/python3.6m/pybind11/cast.h:13:
In file included from /usr/include/python3.6m/pybind11/pytypes.h:12:
/usr/include/python3.6m/pybind11/detail/common.h:386:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
        struct 

Reproducible example code

Add #include <pybind11/detail/common.h> to python_example and compile with

CC=clang CFLAGS=-Wpedantic CXX=clang setup.py build_ext

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions