Opened 7 years ago

Last modified 4 years ago

#2677 new defect

General clang issues

Reported by: stephen Owned by: UnAssigned
Priority: medium Milestone: Outstanding Tasks
Component: build system Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 3 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Whilst addressing #2673, I also noticed the following warnings. The environment was OSX 10.8 with clang 4.1:

src/lib/config

  CXX      ccsession.lo
ccsession.cc:345:32: warning: '&&' within '||' [-Wlogical-op-parentheses]
            cur_name[0] == '*' && cur_name[1] == '.') {
            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
ccsession.cc:345:32: note: place parentheses around the '&&' expression to silence this warning
            cur_name[0] == '*' && cur_name[1] == '.') {
                               ^
1 warning generated.

src/lib/asiodns

  CXX      libb10_asiodns_la-udp_server.lo
In file included from udp_server.cc:30:
In file included from ../../../src/lib/asiolink/udp_socket.h:31:
../../../src/lib/asiolink/io_asio_socket.h:347:37: warning: unused parameter 'data' [-Wunused-parameter]
    virtual void asyncReceive(void* data, size_t, size_t, IOEndpoint*, C&) {
   :

(There are a number of these)

  CXXLD    libb10-asiodns.la
libtool: link: warning: `/opt/log4cplus/lib/liblog4cplus.la' seems to be moved
clang: warning: argument unused during compilation: '-pthread'

The "-pthread" message appears at other points in the BIND 10 build, not just in src/lib/asiodns.

  CXX      run_unittests-dns_server_unittest.o
dns_server_unittest.cc:674:18: warning: expression result unused [-Wunused-value]
    EXPECT_THROW(TCPServer(this->service, 0, AF_UNIX, this->checker_,
    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/gtest-1.5.0/include/gtest/gtest.h:1681:21: note: expanded from macro 'EXPECT_THROW'
  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
                    ^
       :

(There are a number of these)

When dealing with unavoidable warnings in a particular part of the build, we should decide whether we disable that particular warning (e.g. -Wno-unused-parameters) or disable the promotion of warnings to errors (-Wno-error).

Subtickets

Change History (11)

comment:1 follow-up: Changed 7 years ago by shane

I thought that these were bugs in Clang and could be fixed by an upgrade?

comment:2 in reply to: ↑ 1 Changed 7 years ago by jinmei

Replying to shane:

I thought that these were bugs in Clang and could be fixed by an upgrade?

Don't know if they are "bugs", but I guess it's quite possible that they
just disappear by an upgrade.

comment:3 Changed 7 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:4 Changed 7 years ago by shane

  • Milestone changed from Previous-Sprint-Proposed to Next-Sprint-Proposed

comment:5 follow-up: Changed 7 years ago by shane

Is this actually clang or maybe gcc? gcc 4.1 exists, clang is only up to 3.2.

comment:6 in reply to: ↑ 5 Changed 7 years ago by jinmei

Replying to shane:

Is this actually clang or maybe gcc? gcc 4.1 exists, clang is only up to 3.2.

I suspect 4.1 is apple's secret version:

% clang++ --version
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

comment:7 Changed 5 years ago by tomek

  • Milestone set to Remaining BIND10 tickets

comment:8 Changed 4 years ago by tomek

  • Milestone changed from Remaining BIND10 tickets to Kea-proposed
  • Version set to git

comment:9 Changed 4 years ago by hschempf

  • Milestone changed from Kea-proposed to DHCP Outstanding Tasks

comment:10 Changed 4 years ago by fdupont

As we daily use clang on OS X without these issues IMHO we can safely close this (obsolete) ticket.

comment:11 Changed 4 years ago by tomek

  • Milestone changed from DHCP Outstanding Tasks to Outstanding Tasks

Milestone renamed

Note: See TracTickets for help on using tickets.