-
Notifications
You must be signed in to change notification settings - Fork 16
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 compiler errors on more recent compilers. #6
Open
fgiancane8
wants to merge
10
commits into
ioquake:master
Choose a base branch
from
fgiancane8:fix-compile-gcc-8
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GCC8 refuses to compile this file because of implicit truncation between integer variables and constants. Extend the size of the in-memory table to fix the issue. Signed-off-by: Francesco Giancane <[email protected]>
GCC8 refuses to compile this file because of (wrong) implicit conversion between boolean and pointers. This was based on the (now wrong) implicit assumption that false would convert to NULL. Signed-off-by: Francesco Giancane <[email protected]>
Some files used for AI for some kind of actors use a static variable called 'move'. Using recently enough compilers, an ambiguity between the aforementioned names would apply. Fix the issue by renaming the global variable. Signed-off-by: Francesco Giancane <[email protected]>
The source file g_weapon.cpp contains a variable called 'forward' which may be evaluated as a reference for std::forward function. Renaming the global variable will fix the ambiguity on more recent compilers. Signed-off-by: Francesco Giancane <[email protected]>
This file contains an implementation of some math functions that can be now found on modern compilers and environment. This can be safely emptied (and then removed when removed from CMakeLists.txt). Signed-off-by: Francesco Giancane <[email protected]>
Adding a static_cast<> to ensure that integral values are correctly promoted to vec3_t. Signed-off-by: Francesco Giancane <[email protected]>
field was wrongly typed as int, but in reality it should store a size_t. This fixes compilation issues on platforms where sizeof(int) != sizeof(size_t). Signed-off-by: Francesco Giancane <[email protected]>
Preprocessed string concatenation was abused in this context. More recent compilers would just reject that syntax and refuse to compile. Rewrite the code so that same output is produced but no error is generated. Signed-off-by: Francesco Giancane <[email protected]>
On some platforms, where sizeof(int) != sizeof(size_t), the struct could not accomodate all the data. Fix the issue by retyping the flags correctly. Signed-off-by: Francesco Giancane <[email protected]>
With the last modification in the structure, the building failure was fixed just for x86_64 machines. Promoting long int to long long (int) fixes the failure for both x86 and x86_64 machines. Tested with Clang and GCC 8. Signed-off-by: Francesco Giancane <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several issues and errors are patched with this PR.
In particular, old compilers quirks were exploited to produce executables and some conversion errors still were there.
Now it is possible to compile (not without warnings...) the executables with clang (6.0.0) and gcc (8.1.1).