-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Do we really need to check if pow
exists in CMake?
#1043
Comments
Fixes issue: vegastrike#1043 Signed-off-by: Vincent Legoll <[email protected]>
We need |
I think the reason for the |
Honestly, I don't get this. According to cppreference.com, pow has been around since forever really. It's part of the standard library. Are you telling me there's a compiler in 2025 that doesn't support it?! |
I think I've read somewhere that there's libms that are automatically added by compilers, but not all compilers do/did that, but that was a long time ago... That may have been a reason for this kind of manual handling. But I really don't know. I created the PR to see if the CI caught something wrong, but it didn't. So how can I dig deeper ? Do we care about what is not covered by the CI ? Anyways, I can drop the PR if this piece of cmake magic is deemed important enough. And BTW I saw we already have some |
@vincele Good questions. I don't know the answers, unfortunately. Perhaps one thing we could check for is fallback code that uses a different method of calculating exponents if |
yes we probably should rely on |
OK, I'll try the full std::pow migration, and we'll see what the CI will tell us... |
Am I missing something? I assume calling |
Fixes issue: vegastrike#1043 Signed-off-by: Vincent Legoll <[email protected]>
That was one of my questions above, that shows I'm more a C than a C++ guy... |
Fixes issue: vegastrike#1043 Signed-off-by: Vincent Legoll <[email protected]>
that depends. If you do: using namespace std; then it could match either one since it would be at the compiler's discretion of which to link against based on which it found. This is is one reason why it's good practice to not import non-local namespaces in C++. It's may be more text to type Header files should never have |
While working on #1041 @royfalk asked:
Back in 2000 it was probably more common that
pow
and other math functions might not exist. But is that really true today? Could we get rid of these checks?The text was updated successfully, but these errors were encountered: