Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcc7fixes #121

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
16aed3d
Make explicit boolean arguments for EXPECT_TRUE test
cstrotm Jan 5, 2017
b0a48c7
Migrate from auto_ptr to unique_ptr
cstrotm Jan 5, 2017
21d208f
explicit boolean argument for ASSERT_TRUE test
cstrotm Jan 5, 2017
b124427
explicit boolean argument for EXPECT_TRUE test
cstrotm Jan 5, 2017
94f4841
Explicit boolean argument for ASSERT_TRUE tests
cstrotm Jan 5, 2017
b6a7de6
explicit boolean arguments for ASSERT_TRUE tests
cstrotm Jan 5, 2017
ba65c2e
explicit boolean arguments for ASSERT_TRUE tests
cstrotm Jan 5, 2017
f15961d
explicit boolean arguments for EXPECT_TRUE tests
cstrotm Jan 5, 2017
fbb9c14
explicit boolean arguments for EXPECT_TRUE tests
cstrotm Jan 5, 2017
db9305c
explicit boolean arguments for ASSERT_TRUE test
cstrotm Jan 5, 2017
d7d124b
explicit boolean arguments for ASSERT_TRUE tests
cstrotm Jan 5, 2017
f35908c
Migrate auto_ptr to unique_ptr
cstrotm Jan 5, 2017
aa9c070
explicit boolean arguments for ASSERT_TRUE test
cstrotm Jan 5, 2017
b276818
explicit boolean arguments for ASSERT_TRUE tests
cstrotm Jan 5, 2017
7c465ed
explicit boolean arguments for EXPECT_TRUE tests
cstrotm Jan 5, 2017
fcc41f8
explicit boolean arguments for ASSERT_TRUE test
cstrotm Jan 5, 2017
86d7b25
explicit boolean arguments for EXPECT_TRUE tests
cstrotm Jan 5, 2017
49e5997
explicit boolean arguments for ASSERT_TRUE test
cstrotm Jan 5, 2017
1c8952f
migrate auto_ptr to unique_ptr
cstrotm Jan 5, 2017
ea18e32
explicit boolean arguments for ASSERT_TRUE test
cstrotm Jan 5, 2017
53f55fa
migrate auto_ptr to unique_ptr
cstrotm Jan 5, 2017
466a3b5
Changes to compile with Botan 2
cstrotm May 11, 2017
6b8d8ad
fix infinitive recursion in Boost ASIO
cstrotm May 11, 2017
08e0257
silence infinitive recursion warning in CLANG
cstrotm May 11, 2017
a44ea58
autotool test for C++ 2011 standard
cstrotm May 11, 2017
098fed8
travis CI
cstrotm Jun 18, 2017
05458ef
generate configure script
cstrotm Jun 18, 2017
97c57c0
C++1x support
cstrotm Jun 18, 2017
ca026b1
remove sudo
cstrotm Jun 18, 2017
a6b8ab3
enabled sudo, disabled clang
cstrotm Jun 18, 2017
e8cb94f
Disable shared memory
cstrotm Jun 18, 2017
2eb58f4
explicit marking fallthrough for gcc 7+
cstrotm Jul 25, 2017
e3271be
removed throw specification (deprecated in C++11)
cstrotm Jul 25, 2017
303dced
removed throw specifications (deprecated in C++11)
cstrotm Jul 25, 2017
4d3f217
marked implicit fall through
cstrotm Jul 25, 2017
691ac6d
marked implicit fall through
cstrotm Jul 25, 2017
38c2a88
Python > 3.4 does not convert float to hex via %x
cstrotm Jul 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sudo: required
language: c++
compiler:
- gcc
# - clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- clang
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libtool automake git build-essential pkg-config
- sudo apt-get install -y python3-dev libsqlite3-dev libbotan1.10-dev liblog4cplus-dev libgtest-dev libboost-dev python-setproctitle libssl-dev
# before build script, run autoreconf
before_script: autoreconf -i

# Default is "./configure && make && make test", but no tests yet
script: "./configure --without-shared-memory && make"

install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
14 changes: 12 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")

# Check for C++11 features support
AX_BUNDY_CPP11

dnl Determine if weare using GNU sed
GNU_SED=no
$SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
Expand Down Expand Up @@ -713,6 +716,7 @@ AC_DEFUN([ACX_TRY_BOTAN_TOOL], [
#AC_MSG_RESULT([found])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <botan/botan.h>
#include <botan/init.h>
#include <botan/hash.h>
],
[using namespace Botan;
Expand Down Expand Up @@ -791,7 +795,7 @@ else
# Ok so no script found, see if pkg-config knows of it.
# Unfortunately, the botan.pc files also have their minor version
# in their name, so we need to try them one by one
BOTAN_VERSIONS="botan-1.10 botan-1.9 botan-1.8"
BOTAN_VERSIONS="botan-2 botan-1.11 botan-1.10 botan-1.9 botan-1.8"
for version in $BOTAN_VERSIONS; do
ACX_TRY_BOTAN_TOOL([pkg-config], ["$version --silence-errors"],
[ BOTAN_CONFIG="$PKG_CONFIG $version" ]
Expand Down Expand Up @@ -873,13 +877,18 @@ CPPFLAGS="$BOTAN_INCLUDES $CPPFLAGS"
LIBS_SAVED="$LIBS"
LIBS="$LIBS $BOTAN_LIBS"


# ac_header_preproc is an autoconf symbol (undocumented but stable) that
# is set if the pre-processor phase passes. Thus by adding a custom
# failure handler we can detect the difference between a header not existing
# (or not even passing the pre-processor phase) and a header file resulting
# in compilation failures.
AC_CHECK_HEADERS([botan/botan.h],,[
if test "x$ac_header_preproc" = "xyes"; then
BOTAN_INCLUDES=""
BOTAN_LIBS=""
BOTAN_LDFLAGS=""
BOTAN_RPATH=""
if test "x$ac_header_preproc" = "xyes"; then
AC_MSG_ERROR([
botan/botan.h was found but is unusable. The most common cause of this problem
is attempting to use an updated C++ compiler with older C++ libraries, such as
Expand All @@ -892,6 +901,7 @@ Boost and Botan that were compiled with the same compiler version.])
)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <botan/botan.h>
#include <botan/init.h>
#include <botan/hash.h>
],
[using namespace Botan;
Expand Down
2 changes: 1 addition & 1 deletion ext/asio/asio/ip/resolver_query_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class resolver_query_base

friend flags operator~(flags x)
{
return static_cast<flags>(static_cast<unsigned int>(~x));
return static_cast<flags>(~static_cast<unsigned int>(x));
}

friend flags& operator&=(flags& x, flags y)
Expand Down
10 changes: 6 additions & 4 deletions ext/coroutine/coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class coroutine_ref
bool modified_;
};

// TODO: make sure these fallthrough are really intended!
#define CORO_REENTER(c) \
switch (coroutine_ref _coro_value = c) \
case -1: if (_coro_value) \
Expand All @@ -102,8 +103,9 @@ class coroutine_ref
bail_out_of_coroutine: \
break; \
} \
else case 0:
else /* fall through */ case 0:

// TODO: make sure these fallthrough are really intended!
#define CORO_YIELD \
for (_coro_value = __LINE__;;) \
if (_coro_value == 0) \
Expand All @@ -114,12 +116,12 @@ class coroutine_ref
else \
switch (_coro_value ? 0 : 1) \
for (;;) \
case -1: if (_coro_value) \
case -1: if (_coro_value) \
goto terminate_coroutine; \
else for (;;) \
case 1: if (_coro_value) \
/* fall through */ case 1: if (_coro_value) \
goto bail_out_of_coroutine; \
else case 0:
else /* fall through */ case 0:

#define CORO_FORK \
for (_coro_value = -__LINE__;; _coro_value = __LINE__) \
Expand Down
122 changes: 122 additions & 0 deletions m4macros/ax_cpp11.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
AC_DEFUN([AX_BUNDY_CPP11], [

CXX_SAVED=$CXX
feature=
for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
if test "$retry" = "fail"; then
AC_MSG_ERROR([$feature (a C++11 feature) is not supported])
fi
if test "$retry" != "none"; then
AC_MSG_WARN([unsupported C++11 feature])
AC_MSG_NOTICE([retrying by adding $retry to $CXX])
CXX="$CXX_SAVED $retry"
AC_MSG_CHECKING($retry support)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[],
[int myincr = 1;])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])
fi

AC_MSG_CHECKING(std::unique_ptr support)
feature="std::unique_ptr"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <memory>],
[std::unique_ptr<int> a;])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(cbegin/cend support)
feature="cbegin/cend"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <string>],
[const std::string& s = "abcd";
unsigned count = 0;
for (std::string::const_iterator i = s.cbegin();
i != s.cend(); ++i)
if (*i == 'b')
++count;])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(final method support)
feature="final method"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[class Foo {
public:
virtual ~Foo() {};
virtual void bar() final;
};],[])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(aggregate initialization support)
feature="aggregate initialization"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <vector>],
[std::vector<int> foo = { 1, 2, 3};])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(variadic template support)
feature="variadic template"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[template<typename ... Args>
struct A {
void foo(Args... myargs) { return; };
};],
[A<> a;
a.foo();])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(static_assert support)
feature="static_assert"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[static_assert(1 + 1 == 2, "");],
[])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(template alias)
feature="template alias"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[template<int i>
class I {
public: int get() { return i; };
};
using Zero = I<0>;],
[Zero Z;
return Z.get();])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])

AC_MSG_CHECKING(lambda support)
feature="lambda"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[],
[auto myincr = [[]](int x) { return x + 1; };])],
[AC_MSG_RESULT([yes])
break],
[AC_MSG_RESULT([no])
continue])
done

])dnl AX_BUNDY_RPATH
12 changes: 6 additions & 6 deletions src/bin/auth/tests/datasrc_clients_mgr_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ shutdownCheck() {
EXPECT_FALSE(cmd.params); // no argument

// Finally, the manager should wait for the thread to terminate.
EXPECT_TRUE(FakeDataSrcClientsBuilder::thread_waited);
EXPECT_TRUE(!!FakeDataSrcClientsBuilder::thread_waited);
}

// Commonly used pattern of checking member variables shared between the
Expand Down Expand Up @@ -175,8 +175,8 @@ TEST(DataSrcClientsMgrTest, holder) {
mgr.reconfigure(reconfigure_arg);
{
TestDataSrcClientsMgr::Holder holder(mgr);
EXPECT_TRUE(holder.findClientList(RRClass::IN()));
EXPECT_TRUE(holder.findClientList(RRClass::CH()));
EXPECT_TRUE(!!holder.findClientList(RRClass::IN()));
EXPECT_TRUE(!!holder.findClientList(RRClass::CH()));
EXPECT_EQ(2, holder.getClasses().size());
}
// We need to clear command queue by hand
Expand All @@ -190,7 +190,7 @@ TEST(DataSrcClientsMgrTest, holder) {
mgr.reconfigure(reconfigure_arg);
{
TestDataSrcClientsMgr::Holder holder(mgr);
EXPECT_TRUE(holder.findClientList(RRClass::IN()));
EXPECT_TRUE(!!holder.findClientList(RRClass::IN()));
EXPECT_FALSE(holder.findClientList(RRClass::CH()));
EXPECT_EQ(RRClass::IN(), holder.getClasses()[0]);
}
Expand Down Expand Up @@ -355,7 +355,7 @@ TEST(DataSrcClientsMgrTest, wakeup) {
mgr.run_one();
EXPECT_TRUE(called);
EXPECT_EQ(1, tag);
EXPECT_TRUE(FakeDataSrcClientsBuilder::callback_queue->empty());
EXPECT_TRUE(!!FakeDataSrcClientsBuilder::callback_queue->empty());

called = false;
// If we wake up and don't push anything, it doesn't break.
Expand All @@ -373,7 +373,7 @@ TEST(DataSrcClientsMgrTest, wakeup) {
}
EXPECT_TRUE(called);
EXPECT_EQ(2, tag);
EXPECT_TRUE(FakeDataSrcClientsBuilder::callback_queue->empty());
EXPECT_TRUE(!!FakeDataSrcClientsBuilder::callback_queue->empty());
}

TEST(DataSrcClientsMgrTest, realThread) {
Expand Down
2 changes: 1 addition & 1 deletion src/bin/auth/tests/datasrc_config_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class DatasrcConfigTest : public ::testing::Test {
EXPECT_EQ(1, lists_.size());
}
FakeSession session;
auto_ptr<ModuleCCSession> mccs;
unique_ptr<ModuleCCSession> mccs;
const string specfile;
std::map<RRClass, ListPtr> lists_;
string log_;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/auth/tests/query_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2716,7 +2716,7 @@ TEST_F(QueryTestForMockOnly, nxdomainWithBadWildcardNSEC3Proof) {
TEST_P(QueryTest, emptyNameWithNSEC3) {
enableNSEC3(rrsets_to_add_);
const Name qname("no.example.com");
ASSERT_TRUE(list_->find(qname).finder_);
ASSERT_TRUE(!!list_->find(qname).finder_);
ZoneFinderContextPtr result =
list_->find(qname).finder_->find(qname, RRType::A(),
ZoneFinder::FIND_DNSSEC);
Expand Down
2 changes: 1 addition & 1 deletion src/bin/msgq/msgq.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class MsgQ:
This is done by using an increasing counter and the current
time."""
self.connection_counter += 1
return "%x_%x@%s" % (time.time(), self.connection_counter,
return "%s_%s@%s" % (time.ctime(), float.hex(self.connection_counter),
self.hostname)

def process_command_ping(self, sock, routing, data):
Expand Down
2 changes: 1 addition & 1 deletion src/lib/acl/tests/loader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class LoaderTest : public ::testing::Test {
EXPECT_NO_THROW(loaded = loader_.loadCheck(
Element::fromJSON(definition)));
boost::shared_ptr<Result> result(dynamic_pointer_cast<Result>(loaded));
EXPECT_TRUE(result);
EXPECT_TRUE(!!result);
return (result);
}
// Load a check and convert it to named check to examine it
Expand Down
2 changes: 2 additions & 0 deletions src/lib/asiodns/dns_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

#pragma clang diagnostic ignored "-Winfinite-recursion"

#ifndef ASIOLINK_DNS_SERVER_H
#define ASIOLINK_DNS_SERVER_H 1

Expand Down
2 changes: 2 additions & 0 deletions src/lib/asiolink/simple_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

#pragma clang diagnostic ignored "-Winfinite-recursion"

#ifndef ASIOLINK_SIMPLE_CALLBACK_H
#define ASIOLINK_SIMPLE_CALLBACK_H 1

Expand Down
3 changes: 0 additions & 3 deletions src/lib/config/module_spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ namespace config {

ModuleSpec::ModuleSpec(ConstElementPtr module_spec_element,
const bool check)
throw(ModuleSpecError)

{
module_specification = module_spec_element;
Expand Down Expand Up @@ -307,7 +306,6 @@ ModuleSpec::validateStatistics(ConstElementPtr data, const bool full,

ModuleSpec
moduleSpecFromFile(const std::string& file_name, const bool check)
throw(JSONError, ModuleSpecError)
{
std::ifstream file;

Expand All @@ -328,7 +326,6 @@ moduleSpecFromFile(const std::string& file_name, const bool check)

ModuleSpec
moduleSpecFromFile(std::ifstream& in, const bool check)
throw(JSONError, ModuleSpecError)
{
ConstElementPtr module_spec_element = Element::fromJSON(in);
if (module_spec_element->contains("module_spec")) {
Expand Down
Loading