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

Annoying compile warnings #414

Closed
ibell opened this issue Nov 5, 2016 · 3 comments
Closed

Annoying compile warnings #414

ibell opened this issue Nov 5, 2016 · 3 comments

Comments

@ibell
Copy link
Contributor

ibell commented Nov 5, 2016

When I compile a library calling cppformat, I get lots of warnings like these when I compile on OSX with Xcode:

../../externals/cppformat/fmt/format.h:1165:3: warning: unused typedef
      'Assert1168' [-Wunused-local-typedef]
  FMT_STATIC_ASSERT(False<T>::value,
  ^
../../externals/cppformat/fmt/format.h:1160:15: note: expanded from macro
      'FMT_STATIC_ASSERT'
  typedef int FMT_CONCAT_(Assert, __LINE__)[(cond) ? 1 : -1] FMT_UNUSED
              ^
../../externals/cppformat/fmt/format.h:1158:28: note: expanded from macro
      'FMT_CONCAT_'
# define FMT_CONCAT_(a, b) FMT_CONCAT(a, b)
                           ^
../../externals/cppformat/fmt/format.h:1142:26: note: expanded from macro
      'FMT_CONCAT'
#define FMT_CONCAT(a, b) a##b
                         ^
<scratch space>:116:1: note: expanded from here
Assert1168

It would be awesome if you would kill these warnings somehow.

@foonathan
Copy link
Contributor

The FMT_UNUSED at the should silence the warning.

Could you go to line 1180 of format.h and insert an #error "foo" in the else of that #ifdef?
And if that error triggers, could you provide the value of FMT_GCC_VERSION?
I can't compile it on XCode.

@vitaut
Copy link
Contributor

vitaut commented Nov 6, 2016

I was able to reproduce it. The problem was in the too conservative GCC version check. The unused attribute is available at least in gcc 3.2.1: https://gcc.gnu.org/onlinedocs/gcc-3.2.1/gcc/Type-Attributes.html#Type%20Attributes. Fixed in 2fa4655. Thanks for reporting!

@vitaut vitaut closed this as completed Nov 6, 2016
@ibell
Copy link
Contributor Author

ibell commented Nov 6, 2016

Great, thanks for fixing this issue. Back to zero warnings in my library

On Sun, Nov 6, 2016 at 12:52 PM, Victor Zverovich notifications@github.com
wrote:

Closed #414 #414.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#414 (comment), or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABxhazIEX9tbkXzSrrM5KG4b4rwctoziks5q7i_2gaJpZM4KqVrz
.

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

No branches or pull requests

3 participants