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 compiler errors on more recent compilers. #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Fix compiler errors on more recent compilers. #6

wants to merge 10 commits into from

Conversation

fgiancane8
Copy link

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).

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant