Project

General

Profile

Actions

Bug #3209

closed

Excessive warnings and debug compilation fails with XCode 7 (clang-700.0.72)

Added by Alex Afanasyev about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
High
Category:
Build
Target version:
Start date:
09/17/2015
Due date:
% Done:

100%

Estimated time:

Description

After clang upgrade, NFD compilation in debug mode fails:

[ 15/200] Compiling tests/daemon/face/websocket.t.cpp
In file included from ../tests/daemon/face/websocket.t.cpp:28:
/Users/cawka/Devel/ndn/NFD/daemon/face/websocket-factory.hpp:89:3: error: 'getChannels' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  getChannels() const;
  ^
/Users/cawka/Devel/ndn/NFD/daemon/face/protocol-factory.hpp:76:3: note: overridden virtual function is here
  getChannels() const = 0;
  ^
1 error generated.

ndn-cxx compilation gives me excessive amounts of -Wunused-local-typedef warnings, example:

In file included from ../tests/unit-tests/util/notification-subscriber.t.cpp:28:
In file included from /Users/cawka/Devel/ndn/ndn-cxx/src/util/notification-subscriber.hpp:51:
In file included from /Users/cawka/Devel/ndn/ndn-cxx/src/util/../face.hpp:27:
In file included from /Users/cawka/Devel/ndn/ndn-cxx/src/util/../name.hpp:30:
In file included from /Users/cawka/Devel/ndn/ndn-cxx/src/name-component.hpp:27:
/Users/cawka/Devel/ndn/ndn-cxx/src/management/../encoding/block-helpers.hpp:195:3: warning: unused typedef 'boost_concept_check195' [-Wunused-local-typedef]
  BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<U>));
  ^
/usr/local/include/boost/concept/assert.hpp:43:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
    BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
    ^
/usr/local/include/boost/concept/detail/general.hpp:79:7: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
      BOOST_PP_CAT(boost_concept_check,__LINE__)             \
      ^
/usr/local/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
#    define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
                               ^
/usr/local/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
#    define BOOST_PP_CAT_I(a, b) a ## b
                                 ^
<scratch space>:165:1: note: expanded from here
boost_concept_check195
^
1 warning generated.
Actions #1

Updated by Alex Afanasyev about 9 years ago

  • Status changed from New to Code review
  • % Done changed from 0 to 50
Actions #2

Updated by Alex Afanasyev about 9 years ago

The issue of unused variable is fixed in boost 1.59, so I wouldn't worry about this.

Actions #3

Updated by Junxiao Shi about 9 years ago

So, override is now mandatory.

Actions #4

Updated by Davide Pesavento about 9 years ago

Junxiao Shi wrote:

So, override is now mandatory.

No, clang only complains when you use it inconsistently, i.e. only when you add it to some (but not all!) methods of a subclass that contains overrides.

Actions #5

Updated by Davide Pesavento about 9 years ago

Alex Afanasyev wrote:

The issue of unused variable is fixed in boost 1.59, so I wouldn't worry about this.

I guess you mean typedef, not variable. We already disabled -Werror for it (#2657), and actually I would support disabling the warning entirely, it doesn't seem too useful anyway.

Actions #6

Updated by Alex Afanasyev about 9 years ago

The offending place (internal typedef for boost concept assert) is already marked as unused. However, boost folks made an error with a non-general way of marking it: before 1.59, it uses #ifdefs to check if compiler is gcc >= 4.4.7; after and including boost 1.59 it is marked using BOOST_ATTRIBUTE_UNUSED which is defined in boost.config.

What I meant is that compilation with clang-7 and boost 1.59 doesn't generate any new warnings. So, I wouldn't do any fixes for it right now.

Actions #7

Updated by Alex Afanasyev about 9 years ago

  • Status changed from Code review to Closed
  • % Done changed from 50 to 100
Actions #8

Updated by Davide Pesavento about 9 years ago

Alex Afanasyev wrote:

What I meant is that compilation with clang-7 and boost 1.59 doesn't generate any new warnings. So, I wouldn't do any fixes for it right now.

Having to upgrade boost is not an acceptable solution on Ubuntu though (15.10 will ship with 1.58 as far as I understand). I know they're just warnings, but they're very verbose and are reported for (almost?) every translation unit... And yes, I know you don't care about clang on linux... but still...

Actions #9

Updated by Alex Afanasyev about 9 years ago

Your call. I'm happy to completely remove this warning (I think I tried to do it originally :-D)

Actions #10

Updated by Junxiao Shi about 9 years ago

Homebrew is still stuck at Boost 1.58 right now. Can we disable -Wunused-local-typedef (or make it non-error) for Boost 1.58 and earlier?

UPDATE: it's already disabled in #2657, but I'm still seeing this error in ndn-cxx with --debug on configure line.

Actions #11

Updated by Davide Pesavento about 9 years ago

Junxiao Shi wrote:

Homebrew is still stuck at Boost 1.58 right now. Can we disable -Wunused-local-typedef (or make it non-error) for Boost 1.58 and earlier?

UPDATE: it's already disabled in #2657, but I'm still seeing this error in ndn-cxx with --debug on configure line.

This completely disables the warning: http://gerrit.named-data.net/2486

But you shouldn't be getting errors if you're using current master, only warnings.

Actions

Also available in: Atom PDF