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 ambiguous abs() calls #13

Merged
merged 1 commit into from
Oct 6, 2017
Merged

fix ambiguous abs() calls #13

merged 1 commit into from
Oct 6, 2017

Conversation

fxcoudert
Copy link
Contributor

@fxcoudert fxcoudert commented Oct 5, 2017

Compilation fails on macOS 10.12 and 10.13 with the latest system compilers (from Xcode 9), because of ambiguous calls to abs() with unsigned int arguments.

@zelurker
Copy link
Owner

zelurker commented Oct 5, 2017

Well this makes the code a lot less readable, but if it's really a problem for you... it really produces an error ? I really wouldn't want to program on osx these days then !
Anyway they are supposed to remove 32 bit support, in this case all this is useless...

@fxcoudert
Copy link
Contributor Author

The code is, in my opinion, flawed anyway: unsigned int - int is promoted to unsigned int, and calling abs() on an unsigned int is… well, not defined.

@zelurker
Copy link
Owner

zelurker commented Oct 6, 2017

Oh well, if that's so important for you... for info with gcc-5.4.0 and -Wall this code does not produce any warning ! but anyway I'll accept it anyway...

@zelurker zelurker merged commit 662cad1 into zelurker:master Oct 6, 2017
@fxcoudert
Copy link
Contributor Author

Thanks!

@zelurker
Copy link
Owner

zelurker commented Oct 7, 2017 via email

@fxcoudert
Copy link
Contributor Author

Indeed in C it is no problem. But in C++ it is not allowed, as you stated. The files modified here are C++.

Thanks for merging the patch.

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.

2 participants