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

Fix a cast error with Windows gcc-based compilers. #30792

Merged
merged 2 commits into from
May 23, 2019
Merged

Fix a cast error with Windows gcc-based compilers. #30792

merged 2 commits into from
May 23, 2019

Conversation

neitsa
Copy link
Contributor

@neitsa neitsa commented May 23, 2019

Summary

SUMMARY: Bugfixes "Fix a cast error with Windows gcc-based compilers."

Purpose of change

An error happens when a gcc based compiler on Windows is trying to compile the game. The error is related to casting the result of GetProcAddress to a function pointer. This is legitimate on Windows, but some compiler (MINGW; MSYS2; etc.) still raise an error about it.

Many thanks to ZhilkinSerg and jbtw for providing help on this topic.

Describe the solution

  • Add gcc pragma push / pop to ignore the cast around the offending lines.
  • Add static const to string vectors (not related to the error, but suggested by ZhilkinSerg).

Describe alternatives you've considered

N/A.

Additional context

See discussions at the bottom of this page.

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system labels May 23, 2019
@ZhilkinSerg ZhilkinSerg merged commit 9014897 into CleverRaven:master May 23, 2019
@kevingranade
Copy link
Member

This seems related

src/debug.cpp: In function 'std::__cxx11::string windows_version()':
src/debug.cpp:1019:32: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-Wcast-function-type"

@ZhilkinSerg
Copy link
Contributor

Thanks I will fix today.

@neitsa neitsa deleted the fix/windows_cast_error branch May 24, 2019 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation Error
3 participants