The following message is output when make is executed.
Is there a way to improve it?
Also, what is the effect of using it in this state?
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
prefix.cc: In member function ‘ipv6_addr_t MPPrefix::get_mask() const’:
prefix.cc:921:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prefix.cc: In member function ‘ipv6_addr_t MPPrefix::get_ipaddr() const’:
prefix.cc:926:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prefix.cc: In member function ‘ipv6_addr_t MPPrefix::get_range() const’:
prefix.cc:931:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prefix.cc: In function ‘ipv6_addr_t hex2ipv6(char, ipv6_addr_t)’:
prefix.cc:497:16: warning: ‘char strncat(char, const char, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncat (str, hex, strlen (hex) - strlen(dots) + 1);
prefix.cc:492:16: warning: ‘char* strncat(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncat (str, hex, strlen (hex) - 2);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
prefix.cc: In member function ‘void IPv6PrefixRange::parse(const char*)’:
prefix.cc:628:13: warning: ‘char* strncat(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncat (address, name, strlen (name));
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prefix.cc:576:13: warning: ‘char* strncat(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncat (address, name, strlen (name) - strlen(slash));
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prefix.cc:576:36: note: length computed here
strncat (address, name, strlen (name) - strlen(slash));
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The following message is output when make is executed. Is there a way to improve it? Also, what is the effect of using it in this state?
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: prefix.cc: In member function ‘ipv6_addr_t MPPrefix::get_mask() const’: prefix.cc:921:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ prefix.cc: In member function ‘ipv6_addr_t MPPrefix::get_ipaddr() const’: prefix.cc:926:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ prefix.cc: In member function ‘ipv6_addr_t MPPrefix::get_range() const’: prefix.cc:931:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ prefix.cc: In function ‘ipv6_addr_t hex2ipv6(char, ipv6_addr_t)’: prefix.cc:497:16: warning: ‘char strncat(char, const char, size_t)’ specified bound depends on the length of the source argument [-Wstringop-overflow=] strncat (str, hex, strlen (hex) - strlen(dots) + 1);