diff --git a/cmake/BuildLibEIO.cmake b/cmake/BuildLibEIO.cmake index dea3e5635ee99e092f071976fa5db3777ae8bd20..588826c2dcfb4ad9f8b18b9698e0cda919f7c68f 100644 --- a/cmake/BuildLibEIO.cmake +++ b/cmake/BuildLibEIO.cmake @@ -3,22 +3,8 @@ macro(libeio_build) set(eio_compile_flags) - set(eio_compile_flags "${eio_compile_flags} -Wno-unused") - if (CC_HAS_WNO_DANGLING_ELSE) - set(eio_compile_flags "${eio_compile_flags} -Wno-dangling-else") - endif() - if (CC_HAS_WNO_PARENTHESES) - set(eio_compile_flags "${eio_compile_flags} -Wno-parentheses") - endif() - if (CC_HAS_WNO_UNUSED_FUNCTION) - set(eio_compile_flags "${eio_compile_flags} -Wno-unused-function") - endif() - if (CC_HAS_WNO_UNUSED_VALUE) - set(eio_compile_flags "${eio_compile_flags} -Wno-unused-value") - endif() - if (CC_HAS_WNO_UNUSED_RESULT) - set(eio_compile_flags "${eio_compile_flags} -Wno-unused-result") - endif() + # See comments in BuildLibEV.cmake + set(eio_compile_flags "${eio_compile_flags} -w") set(eio_compile_flags "${eio_compile_flags} -DENABLE_BUNDLED_LIBEIO=1") set(eio_compile_flags "${eio_compile_flags} -DEIO_STACKSIZE=0") if (TARGET_OS_LINUX) diff --git a/cmake/BuildLibEV.cmake b/cmake/BuildLibEV.cmake index 63abc1994fe0cb7bc3cda74d8344efb160f5bdd5..58e970851e834d7b7f9b8344069bf7e80e3052d5 100644 --- a/cmake/BuildLibEV.cmake +++ b/cmake/BuildLibEV.cmake @@ -11,18 +11,6 @@ macro(libev_build) # place: set(ev_compile_flags "${ev_compile_flags} -w") -# if (CC_HAS_WNO_UNUSED_RESULT) -# set(ev_compile_flags "${ev_compile_flags} -Wno-unused-value") -# endif() -# if (CC_HAS_WNO_COMMENT) -# set(ev_compile_flags "${ev_compile_flags} -Wno-comment") -# endif() -# if (CC_HAS_FNO_STRICT_ALIASING) -# set(ev_compile_flags "${ev_compile_flags} -fno-strict-aliasing") -# endif() -# if (CC_HAS_WNO_PARENTHESES) -# set(ev_compile_flags "${ev_compile_flags} -Wno-parentheses") -# endif() set(ev_compile_flags "${ev_compile_flags} -DENABLE_BUNDLED_LIBEV=1") if (TARGET_OS_LINUX) diff --git a/cmake/BuildLibYAML.cmake b/cmake/BuildLibYAML.cmake index fe20666797d2c6aa9669e528989a6ef4f729e3bd..113e0eae361bc433b202efda2d7d9a30ab75ed6c 100644 --- a/cmake/BuildLibYAML.cmake +++ b/cmake/BuildLibYAML.cmake @@ -5,10 +5,8 @@ macro(libyaml_build) set(LIBYAML_LIBRARIES yaml) add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/libyaml) - if (CC_HAS_WNO_PARENTHESES_EQUALITY) - set(yaml_compile_flags "${yaml_compile_flags} -Wno-parentheses-equality") - endif() - set_target_properties(yaml PROPERTIES COMPILE_FLAGS "${yaml_compile_flags}") + # See comments in BuildLibEV.cmake + set_target_properties(yaml PROPERTIES COMPILE_FLAGS "-w") find_package_message(LIBYAML "Using bundled libyaml" diff --git a/cmake/BuildZSTD.cmake b/cmake/BuildZSTD.cmake index 627262e08f28700eb5e198872400913fd16611f9..383ea057a765bfbd3d6906700245358955c44b0c 100644 --- a/cmake/BuildZSTD.cmake +++ b/cmake/BuildZSTD.cmake @@ -1,5 +1,5 @@ macro(zstd_build) - add_library(zstd STATIC + set(zstd_src third_party/zstd/lib/common/zstd_common.c third_party/zstd/lib/common/entropy_common.c third_party/zstd/lib/common/xxhash.c @@ -9,7 +9,14 @@ macro(zstd_build) third_party/zstd/lib/compress/zstd_compress.c third_party/zstd/lib/compress/huf_compress.c third_party/zstd/lib/compress/fse_compress.c -) + ) + + if (CC_HAS_WNO_IMPLICIT_FALLTHROUGH) + set_source_files_properties(${zstd_src} + PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough) + endif() + + add_library(zstd STATIC ${zstd_src}) set(ZSTD_LIBRARIES zstd) set(ZSTD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/zstd/lib diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 8e8cc57d84f1dac017df79ac5cfd06404e281b11..32b1738bb571fff96856c740789b17e6f5001c15 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -87,16 +87,8 @@ endif() # GCC can also be built on top of llvm runtime (on mac). # -check_c_compiler_flag("-Wno-unused-const-variable" CC_HAS_WNO_UNUSED_CONST_VARIABLE) -check_c_compiler_flag("-Wno-unused-result" CC_HAS_WNO_UNUSED_RESULT) -check_c_compiler_flag("-Wno-unused-value" CC_HAS_WNO_UNUSED_VALUE) -check_c_compiler_flag("-Wno-unused-function" CC_HAS_WNO_UNUSED_FUNCTION) -check_c_compiler_flag("-fno-strict-aliasing" CC_HAS_FNO_STRICT_ALIASING) -check_c_compiler_flag("-Wno-comment" CC_HAS_WNO_COMMENT) check_c_compiler_flag("-Wno-parentheses" CC_HAS_WNO_PARENTHESES) check_c_compiler_flag("-Wno-parentheses-equality" CC_HAS_WNO_PARENTHESES_EQUALITY) -check_c_compiler_flag("-Wno-undefined-inline" CC_HAS_WNO_UNDEFINED_INLINE) -check_c_compiler_flag("-Wno-dangling-else" CC_HAS_WNO_DANGLING_ELSE) check_c_compiler_flag("-Wno-tautological-compare" CC_HAS_WNO_TAUTOLOGICAL_COMPARE) check_c_compiler_flag("-Wno-misleading-indentation" CC_HAS_WNO_MISLEADING_INDENTATION) check_c_compiler_flag("-Wno-varargs" CC_HAS_WNO_VARARGS) diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake index 897a0ae1d3ef7c7fc5322ca0eca2f2db1eb75e79..e7d1b59391496e2b5ca09eb7314a11f2277fe807 100644 --- a/cmake/luajit.cmake +++ b/cmake/luajit.cmake @@ -155,6 +155,10 @@ macro(luajit_build) if(CC_HAS_WNO_VARARGS) set(luajit_cflags ${luajit_cflags} -Wno-varargs) endif() + if (CC_HAS_WNO_IMPLICIT_FALLTHROUGH) + set(luajit_cflags ${luajit_cflags} -Wno-implicit-fallthrough) + endif() + # We are consciously ommiting debug info in RelWithDebInfo mode if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") set (luajit_ccopt -O0) diff --git a/src/box/box.cc b/src/box/box.cc index 04e3b3680951d25d20889ee6da75d07e59d1c6eb..6c4764f5430bda918da56cac8dcc7a4a877f9e3b 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -1004,7 +1004,7 @@ box_process_call(struct request *request, struct obuf *out) */ struct credentials orig_credentials; - struct session *session; + struct session *session = NULL; if (func && func->def.setuid) { /* Save original credentials */ session = current_session(); diff --git a/src/box/vinyl.c b/src/box/vinyl.c index 2396469dfc8f61f9bbf3d97400955be900030f65..0e6ca91d7403d5078a4c519a9f410ed6e73cc709 100644 --- a/src/box/vinyl.c +++ b/src/box/vinyl.c @@ -7060,7 +7060,7 @@ vy_commit(struct vy_env *e, struct vy_tx *tx, int64_t lsn) const struct tuple *delete = NULL, *replace = NULL; enum vy_status status = e->status; int64_t checkpoint_lsn = e->scheduler->checkpoint_lsn; - uint32_t current_space_id = 0; + MAYBE_UNUSED uint32_t current_space_id = 0; stailq_foreach_entry(v, &tx->log, next_in_log) { /* * The tx log contains both reads and writes, but diff --git a/src/box/vy_stmt.c b/src/box/vy_stmt.c index 3b976ac506729809bfdb1449067a21a28c7b8f04..780920c2eec005d25c2e60f88fc0a2b58eb74b36 100644 --- a/src/box/vy_stmt.c +++ b/src/box/vy_stmt.c @@ -298,6 +298,7 @@ vy_stmt_replace_from_upsert(struct tuple_format *replace_format, /* Copy statement data excluding UPSERT operations */ struct tuple_format *format = tuple_format_by_id(upsert->format_id); + (void)format; /* * UPSERT must have the n_upserts field in the extra * memory. diff --git a/src/box/xctl.c b/src/box/xctl.c index 436f1a36f7ebed08fbce951b8bce6792047c81f2..46dd8c2cf687a3c4d8ba768eb15549e58db43ba8 100644 --- a/src/box/xctl.c +++ b/src/box/xctl.c @@ -1362,7 +1362,7 @@ xctl_recovery_create_vy_run(struct xctl_recovery *recovery, int64_t vy_run_id) } struct mh_i64ptr_t *h = recovery->vy_run_hash; struct mh_i64ptr_node_t node = { vy_run_id, run }; - struct mh_i64ptr_node_t *old_node; + struct mh_i64ptr_node_t *old_node = NULL; if (mh_i64ptr_put(h, &node, &old_node, NULL) == mh_end(h)) { diag_set(OutOfMemory, 0, "mh_i64ptr_put", "mh_i64ptr_node_t"); free(run); diff --git a/src/lib/msgpuck b/src/lib/msgpuck index 2598bce249077ca49ba311247e03b2a10558bbbb..ed2cdbd2cf2cfdd104b703214d0647939d00b891 160000 --- a/src/lib/msgpuck +++ b/src/lib/msgpuck @@ -1 +1 @@ -Subproject commit 2598bce249077ca49ba311247e03b2a10558bbbb +Subproject commit ed2cdbd2cf2cfdd104b703214d0647939d00b891 diff --git a/third_party/gopt/gopt.c b/third_party/gopt/gopt.c index a7661748ded7ceed3d186b5ab8e357e7a93b108a..fd916f811417ce335e7e2a55052f608b137eae1e 100644 --- a/third_party/gopt/gopt.c +++ b/third_party/gopt/gopt.c @@ -281,7 +281,7 @@ void gopt_help(const void *opt_def){ */ const int long_opt_width = 27; /* not counting leading "--" */ - const int help_width = 54; + const size_t help_width = 54; const char help_padding[] = " "; while (opt->key) { diff --git a/third_party/libev/ev.h b/third_party/libev/ev.h index a95bb69c33824413aaa7a9608e9766d57603b387..864e0f79cd0a851d7682e09e8c85a4a5fdc30edc 100644 --- a/third_party/libev/ev.h +++ b/third_party/libev/ev.h @@ -43,7 +43,12 @@ #ifdef __cplusplus # define EV_CPP(x) x # if __cplusplus >= 201103L -# define EV_THROW noexcept +/* + * Avoid noisy "mangled name of 'ev_set_syserr_cb' will change in C++17 + * due to non-throwing" warnings. + * # define EV_THROW noexcept + */ +# define EV_THROW # else # define EV_THROW throw () # endif diff --git a/third_party/qsort_arg.c b/third_party/qsort_arg.c index 7a45b09f5ff479268f40adacea6c902efc182da6..5d0b7ae1c633461dec78a1e919e618a0b9434bd5 100644 --- a/third_party/qsort_arg.c +++ b/third_party/qsort_arg.c @@ -186,11 +186,11 @@ loop:SWAPINIT(a, es); pn = (char *) a + n * es; r = min(pa - (char *) a, pb - pa); vecswap(a, pb - r, r); - r = min(pd - pc, pn - pd - es); + r = min(pd - pc, pn - pd - (intptr_t)es); vecswap(pb, pn - r, r); - if ((r = pb - pa) > es) + if ((r = pb - pa) > (intptr_t)es) qsort_arg(a, r / es, es, cmp, arg); - if ((r = pd - pc) > es) + if ((r = pd - pc) > (intptr_t)es) { /* Iterate rather than recurse to save stack space */ a = pn - r; diff --git a/third_party/qsort_arg_mt.c b/third_party/qsort_arg_mt.c index 0d9a88a70800d3fa87d309727e65bb767b9dbb8f..71ccae37022f42ac7366a228b7fd2914d531e14e 100644 --- a/third_party/qsort_arg_mt.c +++ b/third_party/qsort_arg_mt.c @@ -130,7 +130,7 @@ med3(char *a, char *b, char *c, int (*cmp)(const void *a, const void *b, void *a } static void -qsort_arg_mt_internal(void *a, size_t n, size_t es, +qsort_arg_mt_internal(void *a, size_t n, intptr_t es, int (*cmp)(const void *a, const void *b, void *arg), void *arg) { char *pa, *pb, *pc, *pd, *pl, *pm, *pn;