Commit ecc7a84c authored by DonLakeFlyer's avatar DonLakeFlyer

parent 127d942a
...@@ -67,6 +67,7 @@ linux { ...@@ -67,6 +67,7 @@ linux {
contains(QMAKE_TARGET.arch, x86_64) { contains(QMAKE_TARGET.arch, x86_64) {
message("Windows build") message("Windows build")
CONFIG += WindowsBuild CONFIG += WindowsBuild
CONFIG += WarningsAsErrorsOn
DEFINES += __STDC_LIMIT_MACROS DEFINES += __STDC_LIMIT_MACROS
DEFINES += QGC_GST_TAISYNC_ENABLED DEFINES += QGC_GST_TAISYNC_ENABLED
DEFINES += QGC_GST_MICROHARD_ENABLED DEFINES += QGC_GST_MICROHARD_ENABLED
...@@ -210,14 +211,6 @@ LOCATION_PLUGIN_NAME = QGeoServiceProviderFactoryQGC ...@@ -210,14 +211,6 @@ LOCATION_PLUGIN_NAME = QGeoServiceProviderFactoryQGC
# Turn off serial port warnings # Turn off serial port warnings
DEFINES += _TTY_NOWARN_ DEFINES += _TTY_NOWARN_
#
# By default warnings as errors are turned off. Even so, in order for a pull request
# to be accepted you must compile cleanly with warnings as errors turned on the default
# set of OS builds. See http://www.qgroundcontrol.org/dev/contribute for more details.
# You can use the WarningsAsErrorsOn CONFIG switch to turn warnings as errors on for your
# own builds.
#
MacBuild | LinuxBuild { MacBuild | LinuxBuild {
QMAKE_CXXFLAGS_WARN_ON += -Wall QMAKE_CXXFLAGS_WARN_ON += -Wall
WarningsAsErrorsOn { WarningsAsErrorsOn {
...@@ -234,20 +227,17 @@ MacBuild | LinuxBuild { ...@@ -234,20 +227,17 @@ MacBuild | LinuxBuild {
} }
WindowsBuild { WindowsBuild {
win32-msvc2015 { QMAKE_CFLAGS -= -Zc:strictStrings
QMAKE_CFLAGS -= -Zc:strictStrings
QMAKE_CXXFLAGS -= -Zc:strictStrings
}
QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings
QMAKE_CXXFLAGS -= -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings
QMAKE_CXXFLAGS_WARN_ON += /W3 \ QMAKE_CXXFLAGS_WARN_ON += /W3 \
/wd4996 \ # silence warnings about deprecated strcpy and whatnot /wd4996 \ # silence warnings about deprecated strcpy and whatnot, these come from the shapefile code with is external
/wd4005 \ # silence warnings about macro redefinition /wd4005 \ # silence warnings about macro redefinition, these come from the shapefile code with is external
/wd4290 # ignore exception specifications /wd4290 \ # ignore exception specifications
/wd4267 # silence conversion from 'size_t' to 'int', possible loss of data, these come from gps drivers shared with px4
WarningsAsErrorsOn { WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += /WX QMAKE_CXXFLAGS_WARN_ON += /WX
} }
...@@ -267,10 +257,9 @@ ReleaseBuild { ...@@ -267,10 +257,9 @@ ReleaseBuild {
} }
WindowsBuild { WindowsBuild {
*msvc* { # visual studio spec filter # Run compilation using VS compiler using multiple threads
# Run compilation using VS compiler using multiple threads QMAKE_CXXFLAGS += -MP
QMAKE_CXXFLAGS += -MP
}
# Enable function level linking and enhanced optimized debugging # Enable function level linking and enhanced optimized debugging
QMAKE_CFLAGS_RELEASE += /Gy /Zo QMAKE_CFLAGS_RELEASE += /Gy /Zo
QMAKE_CXXFLAGS_RELEASE += /Gy /Zo QMAKE_CXXFLAGS_RELEASE += /Gy /Zo
......
...@@ -179,7 +179,7 @@ void GPSProvider::publishGPSSatellite() ...@@ -179,7 +179,7 @@ void GPSProvider::publishGPSSatellite()
void GPSProvider::gotRTCMData(uint8_t* data, size_t len) void GPSProvider::gotRTCMData(uint8_t* data, size_t len)
{ {
QByteArray message((char*)data, len); QByteArray message((char*)data, static_cast<int>(len));
emit RTCMDataUpdate(message); emit RTCMDataUpdate(message);
} }
......
...@@ -168,7 +168,7 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode ...@@ -168,7 +168,7 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
// Validate returned items // Validate returned items
size_t cMissionItemsExpected; int cMissionItemsExpected;
if (shouldFail) { if (shouldFail) {
cMissionItemsExpected = 0; cMissionItemsExpected = 0;
...@@ -182,14 +182,14 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode ...@@ -182,14 +182,14 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
QCOMPARE(_missionManager->missionItems().count(), (int)cMissionItemsExpected); QCOMPARE(_missionManager->missionItems().count(), (int)cMissionItemsExpected);
size_t firstActualItem = 0; int firstActualItem = 0;
if (_mockLink->getFirmwareType() == MAV_AUTOPILOT_ARDUPILOTMEGA) { if (_mockLink->getFirmwareType() == MAV_AUTOPILOT_ARDUPILOTMEGA) {
// First item is home position, don't validate it // First item is home position, don't validate it
firstActualItem++; firstActualItem++;
} }
int testCaseIndex = 0; int testCaseIndex = 0;
for (size_t actualItemIndex=firstActualItem; actualItemIndex<cMissionItemsExpected; actualItemIndex++) { for (int actualItemIndex=firstActualItem; actualItemIndex<cMissionItemsExpected; actualItemIndex++) {
const TestCase_t* testCase = &_rgTestCases[testCaseIndex]; const TestCase_t* testCase = &_rgTestCases[testCaseIndex];
int expectedSequenceNumber = testCase->expectedItem.sequenceNumber; int expectedSequenceNumber = testCase->expectedItem.sequenceNumber;
......
...@@ -1916,7 +1916,7 @@ bool Vehicle::_containsLink(LinkInterface* link) ...@@ -1916,7 +1916,7 @@ bool Vehicle::_containsLink(LinkInterface* link)
void Vehicle::_addLink(LinkInterface* link) void Vehicle::_addLink(LinkInterface* link)
{ {
if (!_containsLink(link)) { if (!_containsLink(link)) {
qCDebug(VehicleLog) << "_addLink:" << QString("%1").arg((ulong)link, 0, 16); qCDebug(VehicleLog) << "_addLink:" << QString("%1").arg((qulonglong)link, 0, 16);
_links += link; _links += link;
if (_links.count() <= 1) { if (_links.count() <= 1) {
_updatePriorityLink(true /* updateActive */, false /* sendCommand */); _updatePriorityLink(true /* updateActive */, false /* sendCommand */);
......
...@@ -780,7 +780,7 @@ void MockLink::_handleParamRequestRead(const mavlink_message_t& msg) ...@@ -780,7 +780,7 @@ void MockLink::_handleParamRequestRead(const mavlink_message_t& msg)
mavlink_param_request_read_t request; mavlink_param_request_read_t request;
mavlink_msg_param_request_read_decode(&msg, &request); mavlink_msg_param_request_read_decode(&msg, &request);
const QString paramName(QString::fromLocal8Bit(request.param_id, strnlen(request.param_id, MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_PARAM_ID_LEN))); const QString paramName(QString::fromLocal8Bit(request.param_id, static_cast<int>(strnlen(request.param_id, MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_PARAM_ID_LEN))));
int componentId = request.target_component; int componentId = request.target_component;
// special case for magic _HASH_CHECK value // special case for magic _HASH_CHECK value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment