diff --git a/cmake_modules/TokuSetupCompiler.cmake b/cmake_modules/TokuSetupCompiler.cmake index 92897b88f..4a6100ffe 100644 --- a/cmake_modules/TokuSetupCompiler.cmake +++ b/cmake_modules/TokuSetupCompiler.cmake @@ -2,6 +2,10 @@ function(add_c_defines) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${ARGN}) endfunction(add_c_defines) +## always want these +set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") + if (APPLE) add_c_defines(DARWIN=1 _DARWIN_C_SOURCE) endif () @@ -170,10 +174,6 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang) prepend_cflags_if_supported(-Wcast-align) endif () -## always want these -set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") - # pick language dialect set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}") check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11) diff --git a/portability/tests/test-xid.cc b/portability/tests/test-xid.cc index 9ee68906b..6143d3b58 100644 --- a/portability/tests/test-xid.cc +++ b/portability/tests/test-xid.cc @@ -54,7 +54,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // since we implement the same thing here as in toku_os_gettid, this test // is pretty pointless -static int gettid(void) { +static int test_gettid(void) { #if defined(__NR_gettid) return syscall(__NR_gettid); #elif defined(SYS_gettid) @@ -68,6 +68,6 @@ static int gettid(void) { int main(void) { assert(toku_os_getpid() == getpid()); - assert(toku_os_gettid() == gettid()); + assert(toku_os_gettid() == test_gettid()); return 0; } diff --git a/src/tests/test_memcmp_magic.cc b/src/tests/test_memcmp_magic.cc index 8b56e716a..21e131bc0 100644 --- a/src/tests/test_memcmp_magic.cc +++ b/src/tests/test_memcmp_magic.cc @@ -103,7 +103,7 @@ static void test_memcmp_magic_sort_order(void) { DB_ENV *env; r = db_env_create(&env, 0); CKERR(r); r = env->set_default_bt_compare(env, comparison_function_unused); CKERR(r); - r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL+DB_INIT_TXN, 0); CKERR(r); + r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL+DB_INIT_TXN, S_IRUSR+S_IWUSR); CKERR(r); const int magic = 49; diff --git a/src/tests/xa-bigtxn-discard-abort.cc b/src/tests/xa-bigtxn-discard-abort.cc index 9f1b904df..4163d9918 100644 --- a/src/tests/xa-bigtxn-discard-abort.cc +++ b/src/tests/xa-bigtxn-discard-abort.cc @@ -62,7 +62,7 @@ static void populate_foo(DB_ENV *env, DB_TXN *txn) { DB *db = nullptr; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); for (int i = 0; i < test_nrows; i++) { @@ -81,7 +81,7 @@ static void check_foo(DB_ENV *env, DB_TXN *txn) { DB *db; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); DBC *c = nullptr; diff --git a/src/tests/xa-bigtxn-discard-commit.cc b/src/tests/xa-bigtxn-discard-commit.cc index ecbfa18bd..733df036e 100644 --- a/src/tests/xa-bigtxn-discard-commit.cc +++ b/src/tests/xa-bigtxn-discard-commit.cc @@ -59,7 +59,7 @@ static void populate_foo(DB_ENV *env, DB_TXN *txn) { DB *db = nullptr; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); for (int i = 0; i < test_nrows; i++) { @@ -78,7 +78,7 @@ static void check_foo(DB_ENV *env, DB_TXN *txn) { DB *db; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); DBC *c = nullptr;