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 compilation errors with gcc 6.1.1 on Arch Linux #50

Merged
merged 1 commit into from
May 24, 2016

Conversation

Manuel-K
Copy link

I needed to make these changes to compile the project with gcc 6.1.1 on Arch Linux.

@xDShot
Copy link

xDShot commented May 22, 2016

Works for me, thanks.

@icculus icculus merged commit 0b24c2f into icculus:master May 24, 2016
@Manuel-K Manuel-K deleted the gcc-6.1.1-fix branch May 24, 2016 09:46
@DanielGibson
Copy link

DanielGibson commented May 29, 2016

this breaks compilation on my system, at least with clang (haven't tried gcc).

floor() and log10() return double, why would you change the other argument to float (2.0f instead of 2.0) then? Or, why does gcc 6.1.1 not like the original code? does it use some overloaded version of floor() that also supports float or something like that?

Maybe floorf() and log10f() should be used?

@Manuel-K
Copy link
Author

Manuel-K commented May 30, 2016

Very strange.

They do return a float on my system which makes the template explode. Your right, it does seems strange. floor and log10 should return doubles. I only looked at the error message when I made this fix.

I've just compiled it with clang and it does work without problems. If I revert the changes, it even breaks compilation with clang:

/somewhere/Serious-Engine/Sources/EntitiesMP/Player.es:5384:21: error: no matching function for call to 'ClampDn'
FLOAT fTimeDelta  = ClampDn  (floor  (m_tmEstTime ) - floor  (tmLevelTime ) , 0.0);
                    ^~~~~~~
/somewhere/Serious-Engine/Sources/./Engine/Math/Functions.h:85:13: note: candidate template ignored: deduced conflicting types for parameter 'Type'
      ('float' vs. 'double')
inline Type ClampDn( const Type x, const Type dnlimit)

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.

4 participants