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

SDL: Fix warning with GCC 11 on MinGW #3473

Closed
wants to merge 1 commit into from
Closed

Conversation

@orgads
Copy link
Contributor

@orgads orgads commented Oct 30, 2021

In file included from C:/msys64/mingw64/include/c++/11.2.0/cstdlib:41,
                 from C:/msys64/mingw64/include/c++/11.2.0/stdlib.h:36,
                 from ../scummvm/common/scummsys.h:120,
                 from ../scummvm/backends/platform/sdl/win32/win32-main.cpp:28:
C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/c++config.h:573:2: warning: #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported" [-Wcpp]
  573 | #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
      |  ^~~~~~~
In file included from C:/msys64/mingw64/include/c++/11.2.0/cstdlib:41,
                 from C:/msys64/mingw64/include/c++/11.2.0/stdlib.h:36,
                 from ../scummvm/common/scummsys.h:120,
                 from ../scummvm/backends/platform/sdl/win32/win32-main.cpp:28:
C:/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32/bits/c++config.h:573:2: warning: #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported" [-Wcpp]
  573 | #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
      |  ^~~~~~~
@orgads orgads requested a review from lephilousophe Oct 30, 2021
@lephilousophe
Copy link
Member

@lephilousophe lephilousophe commented Oct 31, 2021

This looks like a bit hackish but I don't see other solution.
The main problem is that original mingw32 (not mingw32-w64) doesn't let you access argc and argv with _STRICT_ANSI_ defined.
On the other hand, g++ doesn't let you disable all GNU extension without disabling the non-standard functions and defines...
For reference, warning comes from gcc-mirror/gcc@767537a.

Loading

@sev-
Copy link
Member

@sev- sev- commented Nov 1, 2021

Do I understand correctly, that #3476 should eliminate this problem?

Loading

@orgads
Copy link
Contributor Author

@orgads orgads commented Nov 2, 2021

No, this is still required.

Loading

@lephilousophe
Copy link
Member

@lephilousophe lephilousophe commented Nov 2, 2021

Or we add back the mingw platform to make it use gnu++11 instead of c++11 and it will work without all of this __STRICT_ANSI__ stuff.

Loading

@orgads
Copy link
Contributor Author

@orgads orgads commented Nov 2, 2021

Whatever works for you is fine with me.

Loading

@lephilousophe
Copy link
Member

@lephilousophe lephilousophe commented Nov 2, 2021

Fixed by using gnu++11.

Loading

@orgads
Copy link
Contributor Author

@orgads orgads commented Nov 2, 2021

Thanks!

Loading

@orgads orgads deleted the mingw-warning branch Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants