1
0
Fork 0

windows warning as errors, masquerade remaining unfixeable errors (#9249)

This commit is contained in:
Wilfried Goesgens 2019-06-17 16:21:29 +02:00 committed by Frank Celler
parent 50ce41e062
commit 6fd3dd024c
19 changed files with 122 additions and 35 deletions

View File

@ -291,3 +291,26 @@ if (EXISTS ${STARTER_SOURCE})
MESSAGE(WARNING "arangodb starter source present, but no go command to build it found.")
endif()
endif()
add_library(fuerte STATIC
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/connection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/ConnectionBuilder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/http.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/HttpConnection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/jwt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/loop.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/message.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/requests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/vst.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/VstConnection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/connection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fuerte/src/http_parser/http_parser.c
)
target_include_directories(fuerte SYSTEM PRIVATE
"${Boost_INCLUDE_DIRS}/"
"${CMAKE_CURRENT_SOURCE_DIR}/velocypack/include"
"${CMAKE_CURRENT_SOURCE_DIR}/fuerte/include")

View File

@ -151,7 +151,11 @@ inline size_t RoundUpToPowerOfTwo(size_t value) {
if (sizeof(size_t) == sizeof(uint64_t)) {
return RoundUpToPowerOfTwo64(value);
} else {
#if V8_HOST_ARCH_32_BIT
return RoundUpToPowerOfTwo32(value);
#else
return RoundUpToPowerOfTwo32(static_cast<uint32_t>(value));
#endif
}
}

View File

@ -25,7 +25,7 @@ class JSArrayBuffer : public JSObject {
#if V8_HOST_ARCH_32_BIT
static constexpr size_t kMaxByteLength = kMaxInt;
#else
static constexpr size_t kMaxByteLength = kMaxSafeInteger;
static constexpr size_t kMaxByteLength = static_cast<size_t>(kMaxSafeInteger);
#endif
// [byte_length]: length in bytes

View File

@ -325,9 +325,7 @@ set(BIN_ARANGOSH arangosh)
set(BIN_ARANGOVPACK arangovpack)
# test binaries
set(TEST_BASICS_SUITE basics_suite)
set(TEST_CACHE_SUITE cache_suite)
set(TEST_GEO_SUITE geo_suite)
set(BIN_ARANGODB_TESTS arangodbtests)
set(CLEAN_AUTOGENERATED_FILES)
set(PACKAGES_LIST)
set(COPY_PACKAGES_LIST)

View File

@ -1,5 +1,8 @@
#line 17 "Aql/tokens.ll"
#include <stdint.h>
#if (_MSC_VER >= 1)
#pragma warning( disable : 4267)
#endif

View File

@ -15,6 +15,10 @@
%top{
#include <stdint.h>
#if (_MSC_VER >= 1)
// fix ret_val = EOB_ACT_LAST_MATCH later on, its generated, we can't control this.
#pragma warning( disable : 4267)
#endif
}
%{
@ -610,4 +614,5 @@ class Parser;
return (int) yytext[0];
}
%%

View File

@ -623,6 +623,7 @@ target_link_libraries(arangoserver
${ROCKSDB_LIBS}
${LIB_ARANGO_IRESEARCH}
s2
fuerte
boost_boost
boost_system
${SYSTEM_LIBRARIES}
@ -671,6 +672,11 @@ if (USE_JEMALLOC)
add_dependencies(arangod jemalloc)
endif ()
if(MSVC)
target_compile_options(arangoserver PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
target_compile_options(arangod PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arango-dfdb
################################################################################

View File

@ -77,7 +77,7 @@ static inline arangodb::AgencyOperation CreateCollectionOrder(std::string const&
#endif
arangodb::AgencyOperation op{"Plan/Collections/" + dbName + "/" + collection,
arangodb::AgencyValueOperationType::SET, info};
op._ttl = timeout;
op._ttl = static_cast<uint64_t>(timeout);
return op;
}

View File

@ -38,6 +38,7 @@
#include <velocypack/StringRef.h>
#include <velocypack/velocypack-aliases.h>
using namespace arangodb;
template <typename CMP = geo_index::DocumentsAscending>
@ -325,7 +326,15 @@ Result MMFilesGeoIndex::insert(transaction::Methods& trx, LocalDocumentId const&
IndexValue value(documentId, std::move(centroid));
for (S2CellId cell : cells) {
// The bool comperator is warned about in a unused code branch (which expects an int), MSVC doesn't properly detect this.
#if (_MSC_VER >= 1)
#pragma warning(push)
#pragma warning( disable : 4804)
#endif
_tree.insert(std::make_pair(cell, value));
#if (_MSC_VER >= 1)
#pragma warning(pop)
#endif
}
return res;

View File

@ -37,7 +37,6 @@ namespace velocypack {
class Builder;
}
class Scheduler;
class SchedulerThread;
class SchedulerCronThread;

View File

@ -68,7 +68,7 @@ namespace arangodb {
Scheduler* SchedulerFeature::SCHEDULER = nullptr;
SchedulerFeature::SchedulerFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "Scheduler"),
: ApplicationFeature(server, "Scheduler"),
_scheduler(nullptr) {
setOptional(false);
startsAfter("GreetingsPhase");
@ -162,9 +162,18 @@ void SchedulerFeature::validateOptions(std::shared_ptr<options::ProgramOptions>)
void SchedulerFeature::prepare() {
TRI_ASSERT(2 <= _nrMinimalThreads);
TRI_ASSERT(_nrMinimalThreads <= _nrMaximalThreads);
//wait for windows fix or implement operator new
#if (_MSC_VER >= 1)
#pragma warning(push)
#pragma warning(disable : 4316) // Object allocated on the heap may not be aligned for this type
#endif
_scheduler =
std::make_unique<SupervisedScheduler>(_nrMinimalThreads, _nrMaximalThreads,
_queueSize, _fifo1Size, _fifo2Size);
#if (_MSC_VER >= 1)
#pragma warning(pop)
#endif
SCHEDULER = _scheduler.get();
}

View File

@ -415,7 +415,17 @@ void SupervisedScheduler::startOneThread() {
std::unique_lock<std::mutex> guard(_mutexSupervisor);
// start a new thread
//wait for windows fix or implement operator new
#if (_MSC_VER >= 1)
#pragma warning(push)
#pragma warning(disable : 4316) // Object allocated on the heap may not be aligned for this type
#endif
_workerStates.emplace_back(std::make_shared<WorkerState>(*this));
#if (_MSC_VER >= 1)
#pragma warning(pop)
#endif
if (!_workerStates.back()->start()) {
// failed to start a worker
_workerStates.pop_back(); // pop_back deletes shared_ptr, which deletes thread

View File

@ -34,7 +34,6 @@
#include "Scheduler/Scheduler.h"
namespace arangodb {
class SupervisedSchedulerWorkerThread;
class SupervisedSchedulerManagerThread;
@ -111,6 +110,7 @@ class SupervisedScheduler final : public Scheduler {
// _working indicates if the thread is currently processing a job.
// Hence if you want to know, if the thread has a long running job, test for
// _working && (now - _lastJobStarted) > eps
struct alignas(64) WorkerState {
uint64_t _queueRetryCount; // t1
uint64_t _sleepTimeout_ms; // t2
@ -124,7 +124,6 @@ class SupervisedScheduler final : public Scheduler {
bool start();
};
size_t _maxNumWorker;
size_t _numIdleWorker;
std::list<std::shared_ptr<WorkerState>> _workerStates;
@ -148,6 +147,7 @@ class SupervisedScheduler final : public Scheduler {
bool cleanupAbandonedThreads();
void sortoutLongRunningThreads();
};
} // namespace arangodb
#endif

View File

@ -52,6 +52,10 @@ if (USE_JEMALLOC)
add_dependencies(arangobench jemalloc)
endif ()
if(MSVC)
target_compile_options(arangobench PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arangodump
################################################################################
@ -103,6 +107,10 @@ if (USE_JEMALLOC)
add_dependencies(arangodump jemalloc)
endif ()
if(MSVC)
target_compile_options(arangobench PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arangoexport
################################################################################
@ -152,6 +160,10 @@ if (USE_JEMALLOC)
add_dependencies(arangoexport jemalloc)
endif ()
if(MSVC)
target_compile_options(arangoexport PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arangoimport
################################################################################
@ -184,6 +196,7 @@ target_link_libraries(${BIN_ARANGOIMPORT}
${LIB_ARANGO}
${MSVC_LIBS}
${SYSTEM_LIBRARIES}
fuerte
boost_system
boost_boost
)
@ -194,6 +207,8 @@ install(
install_config(arangoimport)
add_dependencies(arangoimport fuerte)
if (NOT USE_PRECOMPILED_V8)
add_dependencies(arangoimport zlibstatic v8_build) # v8_build includes ICU
# build
@ -205,10 +220,14 @@ if (USE_JEMALLOC)
add_dependencies(arangoimport jemalloc)
endif ()
install_command_alias(${BIN_ARANGOIMPORT}
install_command_alias(arangoimport
${CMAKE_INSTALL_BINDIR}
arangoimp
)
if(MSVC)
target_compile_options(arangoimport PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arangorestore
################################################################################
@ -260,6 +279,9 @@ if (USE_JEMALLOC)
add_dependencies(arangorestore jemalloc)
endif ()
if(MSVC)
target_compile_options(arangorestore PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arangosh
################################################################################
@ -295,6 +317,7 @@ target_link_libraries(${BIN_ARANGOSH}
${LIB_ARANGO}
${LINENOISE_LIBS}
${V8_LIBS}
fuerte
${MSVC_LIBS}
${SYSTEM_LIBRARIES}
boost_system
@ -317,6 +340,9 @@ if (USE_JEMALLOC)
add_dependencies(arangosh jemalloc)
endif ()
if(MSVC)
target_compile_options(arangosh PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## arangovpack
################################################################################
@ -365,6 +391,9 @@ if (USE_JEMALLOC)
add_dependencies(arangovpack jemalloc)
endif ()
if(MSVC)
target_compile_options(arangovpack PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
################################################################################
## foxx-manager
################################################################################

View File

@ -472,7 +472,7 @@ void ManagedDirectory::File::write(char const* data, size_t length) {
}
#endif
if (isGzip()) {
gzwrite(_gzFile, data, length);
gzwrite(_gzFile, data, static_cast<unsigned int>(length));
} else {
::rawWrite(_fd, data, length, _status, _path, _flags);
}
@ -494,7 +494,7 @@ ssize_t ManagedDirectory::File::read(char* buffer, size_t length) {
}
#endif
if (isGzip()) {
bytesRead = gzread(_gzFile, buffer, length);
bytesRead = gzread(_gzFile, buffer, static_cast<unsigned int>(length));
} else {
bytesRead = ::rawRead(_fd, buffer, length, _status, _path, _flags);
} // else

View File

@ -89,23 +89,6 @@ set(LIB_ARANGO_VPACK
${PROJECT_SOURCE_DIR}/lib/Basics/xxhash.cpp
)
set(LIB_ARANGO_FUERTE
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/connection.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/ConnectionBuilder.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/helper.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/http.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/HttpConnection.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/jwt.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/loop.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/message.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/requests.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/types.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/vst.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/VstConnection.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/connection.cpp
${PROJECT_SOURCE_DIR}/3rdParty/fuerte/src/http_parser/http_parser.c
)
add_definitions("-DARCHITECTURE_OPTIMIZATIONS=${ARCHITECTURE_OPTIMIZATIONS}")
if (ASM_OPTIMIZATIONS AND CMAKE_TARGET_ARCHITECTURE_CODE MATCHES "x86_64")
@ -131,7 +114,6 @@ add_library(${LIB_ARANGO} STATIC
${LIB_ARANGO_MSVC}
${LIB_ARANGO_POSIX}
${LIB_ARANGO_LINENOISE}
${LIB_ARANGO_FUERTE}
${LIB_ARANGO_VPACK}
${LIB_CLOCK_GETTIME}
${LIB_ASM_SOURCES}
@ -347,3 +329,10 @@ if (USE_ENTERPRISE)
target_compile_definitions(${LIB_ARANGO_V8} PUBLIC "-DUSE_ENTERPRISE=1")
target_include_directories(${LIB_ARANGO_V8} PUBLIC "${PROJECT_SOURCE_DIR}/${ENTERPRISE_INCLUDE_DIR}")
endif()
if(MSVC)
target_compile_options(${LIB_ARANGO_V8} PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
target_compile_options(${LIB_ARANGO_GEO} PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
target_compile_options(${LIB_ARANGO} PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()

View File

@ -2926,7 +2926,7 @@ v8::Handle<v8::Value> TRI_FromJsonString (v8::Isolate* isolate,
yylex_init(&scanner);
struct yyguts_t* yyg = (struct yyguts_t*) scanner;
YY_BUFFER_STATE buf = yy_scan_bytes(text, len, scanner);
YY_BUFFER_STATE buf = yy_scan_bytes(text, static_cast<int>(len), scanner);
int c = yylex(scanner);
v8::Handle<v8::Value> value = ParseValue(isolate, scanner, c);

View File

@ -438,7 +438,7 @@ v8::Handle<v8::Value> TRI_FromJsonString (v8::Isolate* isolate,
yylex_init(&scanner);
struct yyguts_t* yyg = (struct yyguts_t*) scanner;
YY_BUFFER_STATE buf = yy_scan_bytes(text, len, scanner);
YY_BUFFER_STATE buf = yy_scan_bytes(text, static_cast<int>(len), scanner);
int c = yylex(scanner);
v8::Handle<v8::Value> value = ParseValue(isolate, scanner, c);

View File

@ -217,6 +217,7 @@ endif()
target_link_libraries(arangodbtests
arangoserver
rocksdb
fuerte
gtest
)
@ -224,13 +225,15 @@ target_include_directories(arangodbtests PRIVATE
${INCLUDE_DIRECTORIES}
)
target_include_directories(arangodbtests SYSTEM PRIVATE
${V8_INCLUDE_DIR}
)
if(MSVC)
target_compile_options(arangodbtests PRIVATE /WX /D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
# add these includes as system includes because otherwise
# the compiler will emit warnings for fakeit.hpp
target_include_directories(arangodbtests SYSTEM PRIVATE
${V8_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/3rdParty/fakeit-gtest
${CMAKE_SOURCE_DIR}/3rdParty/rocksdb/${ARANGO_ROCKSDB_VERSION}/third-party/gtest-1.8.1/fused-src
)