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 warnings #220

Merged
merged 4 commits into from
Nov 4, 2015
Merged

Fix warnings #220

merged 4 commits into from
Nov 4, 2015

Conversation

inguin
Copy link
Contributor

@inguin inguin commented Nov 3, 2015

Even more fixes for optional GCC warnings:

  • When building with -Wctor-dtor-privacy, gcc mistakenly assumes that the IsConvertibleToInt template class is unusable. Method visibility changed from private to protected as a workaround.
  • Add a few explicit casts to silence -Wconversion warnings.
  • Disable sign-compare warning in the header. Silencing the warning otherwise would require many explicit casts due to the C/C++ integer promotion rules.
  • Test GCC macros GNUC and __EXCEPTIONS for presence instead of value.

@vitaut
Copy link
Contributor

vitaut commented Nov 4, 2015

Thanks for another great PR. Just one question: could you post the warnings that you get for IsConvertibleToInt with -Wctor-dtor-privacy and the compiler version? I was not able to reproduce this on gcc 4.8.4.

@inguin
Copy link
Contributor Author

inguin commented Nov 4, 2015

I'm getting this warning with gcc 5.1.1 (from Fedora Linux 21):

cppformat/format.h:916:7: warning: all member functions in class ‘fmt::internal::IsConvertibleToInt’ are private [-Wctor-dtor-privacy]

vitaut added a commit that referenced this pull request Nov 4, 2015
@vitaut vitaut merged commit 5b7dd17 into fmtlib:master Nov 4, 2015
@vitaut
Copy link
Contributor

vitaut commented Nov 4, 2015

Merged, thanks!

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