Closed lmartinpierrat closed 6 years ago
All those errors result from our test code, they are not part of the library itself. Our tests were only intended with the CI tests in mind and those are not performance critical, hence they have the asserts enabled.
While I understand that you'd only like to have one code base and not two (which is an exaggeration anyways), the question is still what code you'd like: a) Code that always includes the tests (and is thus slower than necessary) or b) code which has UB because you (or us) missed something.
I currently don't see what you are suggesting, please be more specific of how you'd like the code to be changed. Fix the test code so that it works with both settings? Something else?
The tests should now work in both settings.
**Compiler : gcc (GCC) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc.
Errors :** /postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable] /postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = char; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:99:35: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = float; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:128:67: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = double; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:156:81: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = long double; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:231:82: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = signed char; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:67:14: required from ‘typename std::enable_if<std::is_signed<_Tp>::value>::type check(const string&) [with T = signed char; typename std::enable_if<std::is_signed<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:113:36: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = unsigned char; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:81:14: required from ‘typename std::enable_if<std::is_unsigned<_Tp>::value>::type check(const string&) [with T = unsigned char; typename std::enable_if<std::is_unsigned<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:114:38: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = short int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:67:14: required from ‘typename std::enable_if<std::is_signed<_Tp>::value>::type check(const string&) [with T = short int; typename std::enable_if<std::is_signed<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:115:30: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = short unsigned int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:81:14: required from ‘typename std::enable_if<std::is_unsigned<_Tp>::value>::type check(const string&) [with T = short unsigned int; typename std::enable_if<std::is_unsigned<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:116:39: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:67:14: required from ‘typename std::enable_if<std::is_signed<_Tp>::value>::type check(const string&) [with T = int; typename std::enable_if<std::is_signed<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:117:28: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = unsigned int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:81:14: required from ‘typename std::enable_if<std::is_unsigned<_Tp>::value>::type check(const string&) [with T = unsigned int; typename std::enable_if<std::is_unsigned<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:118:33: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = long int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:67:14: required from ‘typename std::enable_if<std::is_signed<_Tp>::value>::type check(const string&) [with T = long int; typename std::enable_if<std::is_signed<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:119:29: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:81:14: required from ‘typename std::enable_if<std::is_unsigned<_Tp>::value>::type check(const string&) [with T = long unsigned int; typename std::enable_if<std::is_unsigned<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:120:38: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = long long int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:67:14: required from ‘typename std::enable_if<std::is_signed<_Tp>::value>::type check(const string&) [with T = long long int; typename std::enable_if<std::is_signed<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:121:34: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
/postgres/src/test/postgres/basic_datatypes.cpp: In instantiation of ‘void check(const string&, const T&) [with T = long long unsigned int; std::cxx11::string = std::cxx11::basic_string]’:
/postgres/src/test/postgres/basic_datatypes.cpp:81:14: required from ‘typename std::enable_if<std::is_unsigned<_Tp>::value>::type check(const string&) [with T = long long unsigned int; typename std::enable_if<std::is_unsigned<_Tp>::value>::type = void; std::cxx11::string = std::cxx11::basic_string]’
/postgres/src/test/postgres/basic_datatypes.cpp:122:43: required from here
/postgres/src/test/postgres/basic_datatypes.cpp:58:18: error: unused variable ‘v’ [-Werror=unused-variable]
I am not a big fan of assert statement because it provide two different projects based on compilation settings.