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

Werror=undef gives error _HAVE_STDINT_H not defined #6619

Closed
arbruijn opened this issue Nov 25, 2022 · 6 comments
Closed

Werror=undef gives error _HAVE_STDINT_H not defined #6619

arbruijn opened this issue Nov 25, 2022 · 6 comments

Comments

@arbruijn
Copy link

Starting with SDL2 2.26.0, when including SDL.h with compiler option -Werror=undef the following compilation error is returned:
SDL_config.h:548:58: error: "_HAVE_STDINT_H" is not defined, evaluates to 0

It seems to be caused by this change in fd93f81

-#  if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
+#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
@sezero
Copy link
Contributor

sezero commented Nov 25, 2022

CC: @ccawley2011

@ccawley2011
Copy link
Contributor

Changing that line back should be OK, although I wonder why it didn't produce warnings with the standalone MSVC projects or the OpenWatcom makefile.

@sezero
Copy link
Contributor

sezero commented Nov 25, 2022

Please send a patch.

What I do wonder is who the hell defines _HAVE_STDINT_H with that leading underscore..

@slouken
Copy link
Collaborator

slouken commented Nov 25, 2022

What I do wonder is who the hell defines _HAVE_STDINT_H with that leading underscore..

Nobody. Removed. :)

@arbruijn
Copy link
Author

arbruijn commented Dec 1, 2022

Any chance the fix could be included in a 2.26.x release?

slouken added a commit that referenced this issue Dec 1, 2022
slouken added a commit that referenced this issue Dec 1, 2022
@slouken
Copy link
Collaborator

slouken commented Dec 1, 2022

Yep, this will be in 2.26.2, fixed in 2d86b4e

stsquad pushed a commit to qemu/qemu that referenced this issue Jun 6, 2023
There is no need to disable this useful compiler warning for
all versions of the SDL. Unfortunately, various versions are
buggy (beside SDL 2.0.8, the version 2.26.0 and 2.26.1 are
broken, too, see libsdl-org/SDL#6619 ),
but we can use a simple compiler check to see whether we need
the -Wno-undef or not.

This also enables the printing of the version number with
good versions of the SDL in the summary of the meson output
again.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230605114523.282987-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
AntonJohansson pushed a commit to AntonJohansson/qemu-multitcg that referenced this issue Jul 15, 2023
There is no need to disable this useful compiler warning for
all versions of the SDL. Unfortunately, various versions are
buggy (beside SDL 2.0.8, the version 2.26.0 and 2.26.1 are
broken, too, see libsdl-org/SDL#6619 ),
but we can use a simple compiler check to see whether we need
the -Wno-undef or not.

This also enables the printing of the version number with
good versions of the SDL in the summary of the meson output
again.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230605114523.282987-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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

No branches or pull requests

4 participants