BIND 10 #2673: some build related issues in dhcp

BIND 10 Development do-not-reply at isc.org
Wed Jan 30 17:18:08 UTC 2013


#2673: some build related issues in dhcp
--------------------------------------+----------------------------------
                   Reporter:  jinmei  |                 Owner:
                       Type:  defect  |                Status:  new
                   Priority:  medium  |             Milestone:  New Tasks
                  Component:  dhcp    |              Keywords:
               CVSS Scoring:          |             Sensitive:  0
            Defect Severity:  N/A     |           Sub-Project:  DHCP
Feature Depending on Ticket:          |  Estimated Difficulty:  0
        Add Hours to Ticket:  0       |           Total Hours:  0
                  Internal?:  0       |
--------------------------------------+----------------------------------
 I happened to notice a few issues in the DHCP code.  clang++ produced
 warnings like this:

 {{{
 ../dhcp4_srv.cc:280:1: warning: control may reach end of non-void function
 [-Wreturn-type]
 }}}
 and it seems to be a real bug.  This is the method that triggered the
 warning:

 {{{#!cpp
 bool Dhcpv4Srv::writeServerID(const std::string& file_name) {
     fstream f(file_name.c_str(), ios::out | ios::trunc);
     if (!f.good()) {
         return (false);
     }
     f << srvidToString(getServerID());
     f.close();
 }
 }}}
 (btw, the `bool` part should be in a separate line per coding
 guideline, inherited from BIND 9)

 There were several of this type of warnings, also in dhcp6.

 But this should have been noticed much earlier and automatically by
 buildbots, which leads to another issue: `-Werror` is effectively
 disabled due to this:
 {{{
 if USE_CLANGPP
 # Disable unused parameter warning caused by some of the
 # Boost headers when compiling with clang.
 b10_dhcp4_CXXFLAGS = -Wno-unused-parameter
 endif
 }}}

 I'd first suggest re-checking if this `-Wno-xxx` is still necessary;
 often it's a result of naive copy-paste and actually unnecessary.
 If it's still necessary, `b10_dhcp4_CXXFLAGS` should have
 `$(AM_CXXFLAGS)`:
 {{{
 b10_dhcp4_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_CLANGPP
 # Disable unused parameter warning caused by some of the
 # Boost headers when compiling with clang.
 b10_dhcp4_CXXFLAGS += -Wno-unused-parameter
 endif
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/2673>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list