Andrei Pavel [Wed, 5 Jun 2024 12:05:04 +0000 (15:05 +0300)]
[#3350] revert to installing gtest sources for alpine and rpm
This is needed to make --with-gtest-source pass in jenkins.
There was a false misconception that all gtest packages install sources in
/usr/src/googletest. The reality is that alpine and rpm packages install shared
libraries instead.
Andrei Pavel [Mon, 3 Jun 2024 11:36:23 +0000 (14:36 +0300)]
[#2618] fixed another Wshadow and a Wpedantic
iface_mgr_unittest.cc:2853:25: warning: declaration shadows a local variable [-Wshadow]
shared_network_unittest.cc:430:14: warning: use of non-standard escape character '\{' [-Wpedantic]
Andrei Pavel [Thu, 16 May 2024 14:15:01 +0000 (17:15 +0300)]
[#3256] fix common warnings across compilers
```
io_service_thread_pool_unittests.cc:24:12: warning: unused variable 'TEST_TIMEOUT' [-Wunused-const-variable]
mysql_connection_unittest.cc:217:75: warning: declaration of ‘out_bindings’ shadows a previous local [-Wshadow]
mysql_host_data_source.cc:171:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:202:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:220:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:254:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:422:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:554:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:579:30: warning: useless cast to type ‘isc::dhcp::SubnetID’ {aka ‘unsigned int’} [-Wuseless-cast]
mysql_host_data_source.cc:586:30: warning: useless cast to type ‘isc::dhcp::SubnetID’ {aka ‘unsigned int’} [-Wuseless-cast]
mysql_host_data_source.cc:674:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:714:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:1313:18: warning: 'processFetchedData' overrides a member function but is not marked 'override' [-Wsuggest-override]
mysql_host_data_source.cc:1353:37: warning: 'createBindForReceive' overrides a member function but is not marked 'override' [-Wsuggest-override]
mysql_host_data_source.cc:1371:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:1456:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:1487:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:1508:18: warning: 'processFetchedData' overrides a member function but is not marked 'override' [-Wsuggest-override]
mysql_host_data_source.cc:1542:37: warning: 'createBindForReceive' overrides a member function but is not marked 'override' [-Wsuggest-override]
mysql_host_data_source.cc:1583:6: warning: extra ';' after member function definition [-Wextra-semi]
mysql_host_data_source.cc:1803:25: warning: unused variable 'OPTION_ID_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1804:25: warning: unused variable 'CODE_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1805:25: warning: unused variable 'VALUE_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1806:25: warning: unused variable 'FORMATTED_VALUE_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1807:25: warning: unused variable 'SPACE_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1808:25: warning: unused variable 'PERSISTENT_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1809:25: warning: unused variable 'CANCELLED_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1810:25: warning: unused variable 'USER_CONTEXT_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1811:25: warning: unused variable 'DHCP_SUBNET_ID_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:1812:25: warning: unused variable 'HOST_ID_COL' [-Wunused-const-variable]
mysql_host_data_source.cc:3222:24: warning: useless cast to type ‘char*’ [-Wuseless-cast]
mysql_host_data_source.cc:3385:24: warning: useless cast to type ‘char*’ [-Wuseless-cast]
mysql_host_data_source.cc:3426:24: warning: useless cast to type ‘char*’ [-Wuseless-cast]
mysql_lease_mgr.cc:89:14: warning: unused variable 'HOSTNAME_MAX_LEN' [-Wunused-const-variable]
mysql_lease_mgr.cc:95:14: warning: unused variable 'ADDRESS6_TEXT_MAX_LEN' [-Wunused-const-variable]
mysql_lease_mgr.cc:98:14: warning: unused variable 'USER_CONTEXT_MAX_LEN' [-Wunused-const-variable]
mysql_lease_mgr.cc:544:29: warning: useless cast to type ‘isc::db::my_bool*’ {aka ‘bool*’} [-Wuseless-cast]
mysql_lease_mgr.cc:1929:10: warning: 'start' overrides a member function but is not marked 'override' [-Wsuggest-override]
mysql_lease_mgr.cc:2010:30: warning: useless cast to type ‘isc::dhcp::SubnetID’ {aka ‘unsigned int’} [-Wuseless-cast]
mysql_lease_mgr.cc:2020:10: warning: 'getNextRow' overrides a member function but is not marked 'override' [-Wsuggest-override]
mysql_lease_mgr.cc:3427:13: warning: useless cast to type ‘uint64_t’ {aka ‘long unsigned int’} [-Wuseless-cast]
mysql_lease_mgr.cc:4114:23: warning: variable length arrays are a C99 feature [-Wvla-extension]
mysql_lease_mgr.cc:4226:23: warning: variable length arrays are a C99 feature [-Wvla-extension]
option_opaque_data_tuples_unittest.cc:533:32: warning: zero size arrays are an extension [-Wzero-length-array]
option_opaque_data_tuples_unittest.cc:552:32: warning: zero size arrays are an extension [-Wzero-length-array]
option_opaque_data_tuples_unittest.cc:572:32: warning: zero size arrays are an extension [-Wzero-length-array]
tcp_connection.cc:28:14: warning: unused variable 'MAX_LOGGED_MESSAGE_SIZE' [-Wunused-const-variable]
test_control.cc:1826:23: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast]
test_control.cc:1830:24: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast]
test_control.cc:1871:34: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast]
test_control.cc:1873:30: warning: useless cast to type ‘class isc::asiolink::IOAddress’ [-Wuseless-cast]
../../../src/lib/http/http_message_parser_base.h:26:45: warning: extra ‘;’ after in-class function definition [-Wextra-semi]
../../../src/lib/http/http_message_parser_base.h:174:18: warning: ‘virtual void isc::http::HttpMessageParserBase::defineEvents()’ can be marked override [-Wsuggest-override]
../../../src/lib/http/http_message_parser_base.h:177:18: warning: ‘virtual void isc::http::HttpMessageParserBase::verifyEvents()’ can be marked override [-Wsuggest-override]
../../../src/lib/http/http_message_parser_base.h:180:18: warning: ‘virtual void isc::http::HttpMessageParserBase::defineStates()’ can be marked override [-Wsuggest-override]
../../../src/lib/http/http_message_parser_base.h:233:18: warning: ‘virtual void isc::http::HttpMessageParserBase::onModelFailure(const string&)’ can be marked override [-Wsuggest-override]
```
Andrei Pavel [Thu, 16 May 2024 12:45:54 +0000 (15:45 +0300)]
[#3256] fix Wtype-limits warnings
```
data.cc:905:21: warning: comparison is always true due to limited range of data type [-Wtype-limits]
data.cc:905:48: warning: comparison is always false due to limited range of data type [-Wtype-limits]
http_message_parser_base.cc:266:15: warning: comparison is always true due to limited range of data type [-Wtype-limits]
http_message_parser_base.cc:271:17: warning: comparison is always true due to limited range of data type [-Wtype-limits]
```
Andrei Pavel [Thu, 16 May 2024 12:45:41 +0000 (15:45 +0300)]
[#3256] attempt to fix nonsense Wstringop-overread
```
warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
```
and Wsign-compare in the same file:
```
test_control.cc:116:35: warning: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long') and 'int' [-Wsign-compare] 338ms
test_control.cc:491:43: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'const int' [-Wsign-compare]
test_control.cc:529:50: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'const int' [-Wsign-compare]
```