Skip to content
Snippets Groups Projects
Commit 480f7807 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix warnings and errors on GCC 5.3.1

parent e15bc621
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,22 @@
macro(libeio_build)
set(eio_compile_flags)
set(eio_compile_flags "${eio_compile_flags} -Wno-unused-result")
set(eio_compile_flags "${eio_compile_flags} -Wno-dangling-else")
set(eio_compile_flags "${eio_compile_flags} -Wno-unused-value")
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()
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)
......
......@@ -11,6 +11,11 @@ macro(libyaml_build)
${PROJECT_SOURCE_DIR}/third_party/libyaml/writer.c)
add_library(yaml STATIC ${yaml_src})
set(yaml_compile_flags -Wno-unused)
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}")
set(LIBYAML_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/third_party/libyaml)
set(LIBYAML_LIBRARIES yaml)
......
......@@ -202,10 +202,13 @@ endif()
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)
if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCC)
set(HAVE_BUILTIN_CTZ 1)
......
......@@ -14,7 +14,6 @@
int main(int argc, char** argv) {
const char *prefix = "";
const char *suffix = "\n";
int no_quote = 0; /* if 1, do not prepend and append quotation marks (") */
FILE *in = stdin;
FILE *out = stdout;
......
......@@ -330,7 +330,7 @@ static void json_append_number(struct luaL_serializer *cfg, strbuf_t *json,
static void json_append_object(lua_State *l, struct luaL_serializer *cfg,
int current_depth, strbuf_t *json)
{
int comma, keytype;
int comma;
/* Object */
strbuf_append_char(json, '{');
......@@ -344,8 +344,6 @@ static void json_append_object(lua_State *l, struct luaL_serializer *cfg,
else
comma = 1;
/* table, key, value */
keytype = lua_type(l, -2);
struct luaL_field field;
luaL_checkfield(l, cfg, -2, &field);
if (field.type == MP_UINT) {
......@@ -420,7 +418,6 @@ static void json_append_data(lua_State *l, struct luaL_serializer *cfg,
static int json_encode(lua_State *l)
{
struct luaL_serializer *cfg = luaL_checkserializer(l);
strbuf_t local_encode_buf;
char *json;
int len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment