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

Silence warning C4201: nonstandard extension used: nameless struct/union. #1734

Merged
merged 1 commit into from
May 4, 2024

Conversation

dlemstra
Copy link
Contributor

I am checking if we could switch to the "new" OpenEXRCore api in the @ImageMagick project and I we are getting a build warning when including openexr.h in our Visual Studio project:

Silence warning C4201: nonstandard extension used: nameless struct/union.

An anonymous struct, is not part of the standard ANSI C (C89/C90) or ISO C90. It was introduced in C11 as an optional feature and might not be supported by all compilers, especially in strict ANSI C modes. This PR simplifies the structs to silence this warning.

Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems straightforward. @kdt3rd Was this intended for an upcoming change? It seems that we can simplify at this point.

…ion.

Signed-off-by: Dirk Lemstra <dirk@lemstra.org>
@kdt3rd
Copy link
Contributor

kdt3rd commented May 4, 2024

I had originally added these in anticipation of making simple types for imath, which allows subscript access, but that plan I think has changed. I am ok with making this change.

Do note that the Core library, when being compiled, does require C11 as it uses atomics. (although users of the library do not have that requirement)

@kdt3rd kdt3rd merged commit 1b2b788 into AcademySoftwareFoundation:main May 4, 2024
31 checks passed
@dlemstra dlemstra deleted the silence-warning branch May 4, 2024 09:15
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.

3 participants