enabled more GCC warnings
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-03-08 09:37:23 +01:00
parent a145a868dc
commit 6ccf16f56d
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
17 changed files with 72 additions and 33 deletions

View File

@ -165,6 +165,24 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
"-Wimplicit-fallthrough=1"
"-Wno-unused-parameter"
"-Wno-psabi"
"-Wduplicated-cond" # check for duplicate conditions
"-Wduplicated-branches" # check for duplicate branches
"-Wlogical-op" # Search for bitwise operations instead of logical
"-Wnull-dereference" # Search for NULL dereference
"-Wundef" # Warn if undefind marcos are used
"-Wformat=2" # Format string problem detection
"-Wformat-overflow=2" # Formatting issues in printf
"-Wformat-truncation=2" # Formatting issues in printf
"-Wformat-security" # Search for dangerous printf operations
"-Wstrict-overflow=3" # Warn if integer overflows might happen
"-Warray-bounds=2" # Some array bounds violations will be found
"-Wshift-overflow=2" # Search for bit left shift overflows (<c++14)
"-Wcast-qual" # Warn if the constness is cast away
"-Wstringop-overflow=4"
# -Wstack-protector # Emits a few false positives for low level access
# -Wconversion # Creates many false positives
# -Warith-conversion # Use with Wconversion to find more implicit conversions
# -fanalyzer # Should be used to look through problems
)
# Remove unused sections.
add_compile_options(

View File

@ -29,6 +29,10 @@
#define Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST 0
#ifndef Q7S_SIMPLE_MODE
#define Q7S_SIMPLE_MODE 0
#endif
namespace config {
static const uint32_t SD_CARD_ACCESS_MUTEX_TIMEOUT = 50;

View File

@ -1,6 +1,7 @@
#ifndef MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
#define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_
#include "OBSWConfig.h"
#include <bsp_q7s/memory/SdCardManager.h>
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include <fsfw_hal/linux/uart/UartComIF.h>

View File

@ -1,6 +1,8 @@
#include "SdCardManager.h"
#include "OBSWConfig.h"
#include <fsfw/ipc/MutexGuard.h>
#include <fsfw/timemanager/Countdown.h>
#include <unistd.h>
#include <cstring>
@ -404,16 +406,13 @@ SdCardManager::OpStatus SdCardManager::checkCurrentOp(Operations& currentOp) {
bool bytesRead = false;
#if OBSW_ENABLE_TIMERS == 1
Timer timer;
timer.setTimer(100);
uint32_t remainingTimeMs = 0;
Countdown timer(100);
#endif
while (true) {
ReturnValue_t result = cmdExecutor.check(bytesRead);
// This timer can prevent deadlocks due to missconfigurations
#if OBSW_ENABLE_TIMERS == 1
timer.getTimer(&remainingTimeMs);
if (remainingTimeMs == 0) {
if (timer.hasTimedOut()) {
sif::error << "SdCardManager::checkCurrentOp: Timeout!" << std::endl;
return OpStatus::FAIL;
}

View File

@ -12,7 +12,7 @@
// because UDP packets are not allowed in the VPN
// This will cause the OBSW to initialize the TMTC bridge responsible for exchanging data with the
// CCSDS IP Cores.
#define OBSW_USE_TCP_BRIDGE 1
#define OBSW_USE_TMTC_TCP_BRIDGE 1
namespace common {
extern const uint16_t PUS_PACKET_ID;

View File

@ -41,4 +41,8 @@
* copy & replace here settings you want to change values
*/
#ifndef __DOXYGEN__
#define __DOXYGEN__ 0
#endif
#endif /* LWGPS_HDR_OPTS_H */

2
fsfw

@ -1 +1 @@
Subproject commit d6c1041133822903c123e4efd890b1320e1157c9
Subproject commit 8b1c277c58b608db34bf221a1a79469a809ecbda

@ -1 +1 @@
Subproject commit 52f291692c4074a23743c799148b0432a4e405fa
Subproject commit c5ef1783a3b082c0e88561bd91bc3ee0f459fafc

View File

@ -14,6 +14,10 @@
#define GPS_REPLY_WIRETAPPING 0
#ifndef RPI_TEST_GPS_HANDLER
#define RPI_TEST_GPS_HANDLER 0
#endif
UartTestClass::UartTestClass(object_id_t objectId) : TestTask(objectId) { mode = TestModes::SCEX; }
ReturnValue_t UartTestClass::initialize() {

View File

@ -1,5 +1,6 @@
#include "GPSHyperionLinuxController.h"
#include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/timemanager/Clock.h"

View File

@ -672,7 +672,7 @@ ReturnValue_t StarTrackerHandler::isModeCombinationValid(Mode_t mode, Submode_t
return INVALID_SUBMODE;
}
default:
return HasModesIF::INVALID_MODE;
return HasModesIF::MOVE_IS_INVALID;
}
}

View File

@ -5,6 +5,14 @@
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
#ifndef RPI_TEST_ADIS16507
#define RPI_TEST_ADIS16507 0
#endif
#ifndef RPI_TEST_GPS_HANDLER
#define RPI_TEST_GPS_HANDLER 0
#endif
ReturnValue_t pst::pstGpio(FixedTimeslotTaskIF *thisSequence) {
// Length of a communication cycle
uint32_t length = thisSequence->getPeriodMs();

View File

@ -42,7 +42,7 @@ ReturnValue_t ThermalController::checkModeCommand(Mode_t mode, Submode_t submode
return INVALID_SUBMODE;
}
if ((mode != MODE_OFF) && (mode != MODE_ON) && (mode != MODE_NORMAL)) {
return INVALID_MODE;
return MOVE_IS_INVALID;
}
return RETURN_OK;
}

View File

@ -24,7 +24,7 @@
#include "objects/systemObjectList.h"
#if OBSW_ADD_TCPIP_BRIDGE == 1
#if OBSW_USE_TCP_BRIDGE == 0
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
// UDP server includes
#include "fsfw/osal/common/UdpTcPollingTask.h"
#include "fsfw/osal/common/UdpTmTcBridge.h"
@ -90,7 +90,7 @@ void ObjectFactory::produceGenericObjects() {
pus::PUS_SERVICE_200);
#if OBSW_ADD_TCPIP_BRIDGE == 1
#if OBSW_USE_TCP_BRIDGE == 0
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
auto tmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
sif::info << "Created UDP server for TMTC commanding with listener port "

View File

@ -23,7 +23,7 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack
parseHkTableReply(packet);
handleDeviceTM(&acuHkTableDataset, id, true);
#if OBSW_ENHANCED_PRINTOUT == 1 && OBSW_DEBUG_ACU == 1
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_ACU == 1
acuHkTableDataset.read();
float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1;
float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1;

@ -1 +1 @@
Subproject commit b1594df9303056456604726592635d8a1c987e75
Subproject commit 93e93965e2c6405170b62c523dea1990db02d2ad

2
tmtc

@ -1 +1 @@
Subproject commit 37c1a68da1b465514e84403b06ce40d035e4ad88
Subproject commit d64d443a99a911f946402e59b276566954b5b52b