mirror of https://gitee.com/bigwinds/arangodb
Add Linux to -Werr (#10294)
* Add Linux to -Werr * Fix for linenoise-ng warning * Fix wrong check
This commit is contained in:
parent
15d3b346f4
commit
876660fe15
|
@ -269,8 +269,11 @@ ConversionResult ConvertUTF16toUTF8 (
|
|||
}
|
||||
switch (bytesToWrite) { /* note: everything falls through. */
|
||||
case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
||||
[[fallthrough]];
|
||||
case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
||||
[[fallthrough]];
|
||||
case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
||||
[[fallthrough]];
|
||||
case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
|
||||
}
|
||||
target += bytesToWrite;
|
||||
|
@ -300,7 +303,9 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) {
|
|||
default: return false;
|
||||
/* Everything else falls through when "true"... */
|
||||
case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
|
||||
[[fallthrough]];
|
||||
case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
|
||||
[[fallthrough]];
|
||||
case 2: if ((a = (*--srcptr)) > 0xBF) return false;
|
||||
|
||||
switch (*source) {
|
||||
|
@ -311,6 +316,7 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) {
|
|||
case 0xF4: if (a > 0x8F) return false; break;
|
||||
default: if (a < 0x80) return false;
|
||||
}
|
||||
[[fallthrough]];
|
||||
|
||||
case 1: if (*source >= 0x80 && *source < 0xC2) return false;
|
||||
}
|
||||
|
@ -356,10 +362,15 @@ ConversionResult ConvertUTF8toUTF16 (
|
|||
*/
|
||||
switch (extraBytesToRead) {
|
||||
case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
|
||||
[[fallthrough]];
|
||||
case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
|
||||
[[fallthrough]];
|
||||
case 3: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 2: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 1: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 0: ch += *source++;
|
||||
}
|
||||
ch -= offsetsFromUTF8[extraBytesToRead];
|
||||
|
@ -447,8 +458,11 @@ ConversionResult ConvertUTF32toUTF8 (
|
|||
}
|
||||
switch (bytesToWrite) { /* note: everything falls through. */
|
||||
case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
||||
[[fallthrough]];
|
||||
case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
||||
[[fallthrough]];
|
||||
case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
|
||||
[[fallthrough]];
|
||||
case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
|
||||
}
|
||||
target += bytesToWrite;
|
||||
|
@ -482,10 +496,15 @@ ConversionResult ConvertUTF8toUTF32 (
|
|||
*/
|
||||
switch (extraBytesToRead) {
|
||||
case 5: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 4: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 3: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 2: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 1: ch += *source++; ch <<= 6;
|
||||
[[fallthrough]];
|
||||
case 0: ch += *source++;
|
||||
}
|
||||
ch -= offsetsFromUTF8[extraBytesToRead];
|
||||
|
|
|
@ -985,11 +985,13 @@ foreach(TARGET
|
|||
)
|
||||
target_include_directories(${TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/${ENTERPRISE_INCLUDE_DIR}")
|
||||
|
||||
if (MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(${TARGET} PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
elseif (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(${TARGET} PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -78,13 +78,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangobench jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangobench PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangobench PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## arangobackup
|
||||
|
@ -137,13 +137,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangobackup jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangobackup PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangobackup PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
endif () # USE_ENTERPRISE
|
||||
|
||||
|
@ -196,13 +196,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangodump jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangodump PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangodump PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## arangoexport
|
||||
|
@ -252,13 +252,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangoexport jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangoexport PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangoexport PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## arangoimport
|
||||
|
@ -320,13 +320,13 @@ install_command_alias(arangoimport
|
|||
arangoimp
|
||||
)
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangoimport PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangoimport PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## arangorestore
|
||||
|
@ -377,13 +377,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangorestore jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangorestore PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangorestore PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## arangosh
|
||||
|
@ -442,13 +442,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangosh jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangosh PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangosh PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## arangovpack
|
||||
|
@ -498,13 +498,13 @@ if (USE_JEMALLOC)
|
|||
add_dependencies(arangovpack jemalloc)
|
||||
endif ()
|
||||
|
||||
if(MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arangovpack PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arangovpack PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## foxx-manager
|
||||
|
|
|
@ -306,14 +306,14 @@ if (USE_ENTERPRISE)
|
|||
target_include_directories(arango_v8 PUBLIC "${PROJECT_SOURCE_DIR}/${ENTERPRISE_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
if (MSVC AND USE_FAIL_ON_WARNINGS)
|
||||
if (USE_FAIL_ON_WARNINGS)
|
||||
if (MSVC)
|
||||
target_compile_options(arango_v8 PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
target_compile_options(arango_geo PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
target_compile_options(arango PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (DARWIN AND USE_FAIL_ON_WARNINGS)
|
||||
else ()
|
||||
target_compile_options(arango_v8 PRIVATE -Werror)
|
||||
target_compile_options(arango_geo PRIVATE -Werror)
|
||||
target_compile_options(arango PRIVATE -Werror)
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
Loading…
Reference in New Issue