Skip to content

GLM can't handle -Wpedantic again (GLM 0.9.9.2) #814

Closed
@Cazadorro

Description

similar to this issue #524

Since 2016, GLM has been modified such that anonymous struct checks against GCC -Wpedantic cause warnings again. This appears to be because glm/detail/type_vec2.hpp, glm/detail/type_vec3.hpp and glm/detail/type_vec4.hpp have actually removed the fix seen already in use here

error example:

.../glm/detail/type_vec4.hpp:34:28: error: ISO C++ prohibits anonymous structs [-Werror=pedantic]
     struct { T s, t, p, q; };
                            ^

Last time the following lines were used to simply suppress compiler warnings at critical sites, like so:

#if GLM_COMPILER & GLM_COMPILER_GCC
#				pragma GCC diagnostic push
#				pragma GCC diagnostic ignored "-Wpedantic"
#			endif
#			if GLM_COMPILER & GLM_COMPILER_CLANG
#				pragma clang diagnostic push
#				pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
#				pragma clang diagnostic ignored "-Wnested-anon-types"
#			endif

 ... // anonymous struct code

#			if GLM_COMPILER & GLM_COMPILER_CLANG
#				pragma clang diagnostic pop
#			endif
#			if GLM_COMPILER & GLM_COMPILER_GCC
#				pragma GCC diagnostic pop
#			endif

Is there a reason why this has since been removed as of the latest development branch (as far as I can tell)? There doesn't appear to be a way to simply mute anonymous struct warnings in GCC and pedantic is required for my code base.

I'm able to make the changes locally with no pedantic errors, but I believe this issue has actually regressed into all places where it was previously needed (quaternion and vec1 need this as well?)

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions