CI: Add warnings & error on warnings
parent
52e98af9fd
commit
2209e348a3
|
|
@ -234,54 +234,6 @@ unit_test linux/ubuntu/2204/amd64/clang:
|
|||
- linux-build
|
||||
timeout: 5m
|
||||
|
||||
build linux/fedora/37/amd64/gcc:
|
||||
<<: *build_linux_fedora_gcc
|
||||
image: fedora:37
|
||||
|
||||
unit_test linux/fedora/37/amd64/gcc:
|
||||
<<: *test_linux_fedora_gcc
|
||||
image: fedora:37
|
||||
dependencies:
|
||||
- build linux/fedora/37/amd64/gcc
|
||||
needs:
|
||||
- build linux/fedora/37/amd64/gcc
|
||||
|
||||
build linux/fedora/37/amd64/clang:
|
||||
<<: *build_linux_fedora_clang
|
||||
image: fedora:37
|
||||
|
||||
unit_test linux/fedora/37/amd64/clang:
|
||||
<<: *test_linux_fedora_clang
|
||||
image: fedora:37
|
||||
dependencies:
|
||||
- build linux/fedora/37/amd64/clang
|
||||
needs:
|
||||
- build linux/fedora/37/amd64/clang
|
||||
|
||||
build linux/fedora/38/amd64/gcc:
|
||||
<<: *build_linux_fedora_gcc
|
||||
image: fedora:38
|
||||
|
||||
unit_test linux/fedora/38/amd64/gcc:
|
||||
<<: *test_linux_fedora_gcc
|
||||
image: fedora:38
|
||||
dependencies:
|
||||
- build linux/fedora/38/amd64/gcc
|
||||
needs:
|
||||
- build linux/fedora/38/amd64/gcc
|
||||
|
||||
build linux/fedora/38/amd64/clang:
|
||||
<<: *build_linux_fedora_clang
|
||||
image: fedora:38
|
||||
|
||||
unit_test linux/fedora/38/amd64/clang:
|
||||
<<: *test_linux_fedora_clang
|
||||
image: fedora:38
|
||||
dependencies:
|
||||
- build linux/fedora/38/amd64/clang
|
||||
needs:
|
||||
- build linux/fedora/38/amd64/clang
|
||||
|
||||
build linux/fedora/39/amd64/gcc:
|
||||
<<: *build_linux_fedora_gcc
|
||||
image: fedora:39
|
||||
|
|
@ -306,6 +258,54 @@ unit_test linux/fedora/39/amd64/clang:
|
|||
needs:
|
||||
- build linux/fedora/39/amd64/clang
|
||||
|
||||
build linux/fedora/40/amd64/gcc:
|
||||
<<: *build_linux_fedora_gcc
|
||||
image: fedora:40
|
||||
|
||||
unit_test linux/fedora/40/amd64/gcc:
|
||||
<<: *test_linux_fedora_gcc
|
||||
image: fedora:40
|
||||
dependencies:
|
||||
- build linux/fedora/40/amd64/gcc
|
||||
needs:
|
||||
- build linux/fedora/40/amd64/gcc
|
||||
|
||||
build linux/fedora/40/amd64/clang:
|
||||
<<: *build_linux_fedora_clang
|
||||
image: fedora:40
|
||||
|
||||
unit_test linux/fedora/40/amd64/clang:
|
||||
<<: *test_linux_fedora_clang
|
||||
image: fedora:40
|
||||
dependencies:
|
||||
- build linux/fedora/40/amd64/clang
|
||||
needs:
|
||||
- build linux/fedora/40/amd64/clang
|
||||
|
||||
build linux/fedora/41/amd64/gcc:
|
||||
<<: *build_linux_fedora_gcc
|
||||
image: fedora:41
|
||||
|
||||
unit_test linux/fedora/41/amd64/gcc:
|
||||
<<: *test_linux_fedora_gcc
|
||||
image: fedora:41
|
||||
dependencies:
|
||||
- build linux/fedora/41/amd64/gcc
|
||||
needs:
|
||||
- build linux/fedora/41/amd64/gcc
|
||||
|
||||
build linux/fedora/41/amd64/clang:
|
||||
<<: *build_linux_fedora_clang
|
||||
image: fedora:41
|
||||
|
||||
unit_test linux/fedora/41/amd64/clang:
|
||||
<<: *test_linux_fedora_clang
|
||||
image: fedora:41
|
||||
dependencies:
|
||||
- build linux/fedora/41/amd64/clang
|
||||
needs:
|
||||
- build linux/fedora/41/amd64/clang
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Python Module
|
||||
#-------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
export CFLAGS="-Wall -Werror"
|
||||
export CXXFLAGS="-Wall -Werror"
|
||||
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON \
|
||||
-DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ mkdir build
|
|||
|
||||
REM build
|
||||
cd build
|
||||
set CFLAGS=/WX
|
||||
set CXXFLAGS=/WX
|
||||
set CFLAGS=/WX /W4 /wd4127
|
||||
set CXXFLAGS=/WX /W4 /wd4127
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=ON ..
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
cmake --build .
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Author: BJones
|
||||
*/
|
||||
#include "icsneo/communication/crc32.h"
|
||||
#include <stddef.h>
|
||||
|
||||
static const unsigned long crc32_table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535,
|
||||
0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
|
||||
|
|
@ -49,10 +50,10 @@ static unsigned char rev_crc32_table[256];
|
|||
|
||||
static void revgen(void)
|
||||
{
|
||||
unsigned char k;
|
||||
size_t k;
|
||||
|
||||
for (k = 0; k < 256; k++)
|
||||
rev_crc32_table[crc32_table[k] >> 24] = k;
|
||||
rev_crc32_table[crc32_table[k] >> 24] = (uint8_t)k;
|
||||
}
|
||||
|
||||
uint32_t revcrc32(uint32_t crc, const unsigned char* buf, uint32_t len)
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
using namespace icsneo;
|
||||
|
||||
std::vector<uint8_t> FlexRayControlMessage::BuildBaseControlArgs(uint8_t controller, FlexRay::Opcode op, const std::vector<uint8_t>& args) {
|
||||
std::vector<uint8_t> ret;
|
||||
ret.reserve(args.size() + 4);
|
||||
std::vector<uint8_t> ret(args.size() + 4);
|
||||
ret.push_back(controller);
|
||||
const uint16_t size = uint16_t((std::min)(args.size() + 1, size_t(std::numeric_limits<uint16_t>::max()))); // Add 1 for the opcode
|
||||
ret.push_back(uint8_t(size));
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ typedef union _MACSecSa
|
|||
uint8_t byte[MACSEC_SETTINGS_SA_SIZE];
|
||||
} MACSecSa_t;
|
||||
/* MACsec Flags */
|
||||
static constexpr int MACSEC_SETTINGS_FLAGS_SIZE = 4;
|
||||
typedef union _MACSecFlags
|
||||
{
|
||||
struct
|
||||
|
|
@ -180,6 +179,7 @@ typedef union _MACSecFlags
|
|||
};
|
||||
uint32_t flags_32b;
|
||||
} MACSecFlags_t;
|
||||
#define MACSEC_SETTINGS_FLAGS_SIZE (4)
|
||||
/* MACSec Settings for 1 port/phy */
|
||||
typedef struct MACSEC_CONFIG_t
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,13 +75,15 @@ neomessage_t icsneo::CreateNeoMessage(const std::shared_ptr<Message> message) {
|
|||
lin.length = 1;
|
||||
|
||||
lin.linStatus = {
|
||||
linmsg->statusFlags.TxChecksumEnhanced,
|
||||
linmsg->statusFlags.TxCommander,
|
||||
linmsg->statusFlags.TxResponder,
|
||||
linmsg->statusFlags.UpdateResponderOnce,
|
||||
linmsg->statusFlags.HasUpdatedResponderOnce,
|
||||
linmsg->statusFlags.BusRecovered,
|
||||
linmsg->statusFlags.BreakOnly
|
||||
linmsg->statusFlags.TxChecksumEnhanced, // .txChecksumEnhanced
|
||||
linmsg->statusFlags.TxCommander, // .txCommander
|
||||
linmsg->statusFlags.TxResponder, // .txResponder
|
||||
0, // .txAborted
|
||||
linmsg->statusFlags.UpdateResponderOnce, // .updateResponderOnce
|
||||
linmsg->statusFlags.HasUpdatedResponderOnce, // .hasUpdatedResponderOnce
|
||||
linmsg->statusFlags.BusRecovered, // .busRecovered
|
||||
linmsg->statusFlags.BreakOnly // .breakOnly
|
||||
|
||||
};
|
||||
|
||||
lin.status.linJustBreakSync = linmsg->errFlags.ErrRxBreakSyncOnly;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ void printAPIEvents() {
|
|||
void printDeviceEvents(neodevice_t* device) {
|
||||
neoevent_t events[99];
|
||||
size_t eventCount = 99;
|
||||
if(icsneo_getDeviceEvents(selectedDevice, events, &eventCount)) {
|
||||
if(icsneo_getDeviceEvents(device, events, &eventCount)) {
|
||||
if(eventCount == 1) {
|
||||
printf("1 device event found!\n");
|
||||
printf("Event 0x%x: %s\n", events[0].eventNumber, events[0].description);
|
||||
|
|
@ -160,7 +160,7 @@ char getCharInput(int numArgs, ...) {
|
|||
|
||||
char* list = (char*) calloc(numArgs, sizeof(char));
|
||||
for(int i = 0; i < numArgs; ++i) {
|
||||
*(list + i) = va_arg(vaList, int);
|
||||
*(list + i) = (char)va_arg(vaList, int);
|
||||
}
|
||||
|
||||
va_end(vaList);
|
||||
|
|
@ -285,10 +285,10 @@ int main() {
|
|||
printf("Would you like to open or close %s?\n", productDescription);
|
||||
printf("[1] Open\n[2] Close\n[3] Cancel\n\n");
|
||||
|
||||
char input = getCharInput(3, '1', '2', '3');
|
||||
char userSelection = getCharInput(3, '1', '2', '3');
|
||||
printf("\n");
|
||||
|
||||
switch(input) {
|
||||
switch(userSelection) {
|
||||
case '1':
|
||||
// Attempt to open the selected device
|
||||
if(icsneo_openDevice(selectedDevice)) {
|
||||
|
|
@ -346,10 +346,10 @@ int main() {
|
|||
printf("Would you like to have %s go online or offline?\n", productDescription);
|
||||
printf("[1] Online\n[2] Offline\n[3] Cancel\n\n");
|
||||
|
||||
char input = getCharInput(3, '1', '2', '3');
|
||||
char userSelection = getCharInput(3, '1', '2', '3');
|
||||
printf("\n");
|
||||
|
||||
switch(input) {
|
||||
switch(userSelection) {
|
||||
case '1':
|
||||
// Attempt to go online
|
||||
if(icsneo_goOnline(selectedDevice)) {
|
||||
|
|
@ -394,10 +394,10 @@ int main() {
|
|||
printf("Would you like to enable or disable message polling for %s?\n", productDescription);
|
||||
printf("[1] Enable\n[2] Disable\n[3] Cancel\n\n");
|
||||
|
||||
char input = getCharInput(3, '1', '2', '3');
|
||||
char userSelection = getCharInput(3, '1', '2', '3');
|
||||
printf("\n");
|
||||
|
||||
switch(input) {
|
||||
switch(userSelection) {
|
||||
case '1':
|
||||
// Attempt to enable message polling
|
||||
if(icsneo_enableMessagePolling(selectedDevice)) {
|
||||
|
|
@ -481,8 +481,8 @@ int main() {
|
|||
case ICSNEO_NETWORK_TYPE_CAN: {
|
||||
neomessage_can_t* canMsg = (neomessage_can_t*)frame;
|
||||
printf("\t0x%03x [%zu] ", canMsg->arbid, canMsg->length);
|
||||
for(size_t i = 0; i < canMsg->length; i++) {
|
||||
printf("%02x ", canMsg->data[i]);
|
||||
for(size_t j = 0; j < canMsg->length; j++) {
|
||||
printf("%02x ", canMsg->data[j]);
|
||||
}
|
||||
if(canMsg->status.transmitMessage)
|
||||
printf("TX%s %04x ", canMsg->status.globalError ? " ERR" : "", canMsg->description);
|
||||
|
|
@ -502,11 +502,11 @@ int main() {
|
|||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < dataLen; ++i) {
|
||||
if (i < 2) {
|
||||
printf("%02x ", linMsg->header[i+1]);
|
||||
for(size_t j = 0; j < dataLen; ++j) {
|
||||
if (j < 2) {
|
||||
printf("%02x ", linMsg->header[j+1]);
|
||||
} else {
|
||||
printf("%02x ", linMsg->data[i-2]);
|
||||
printf("%02x ", linMsg->data[j-2]);
|
||||
}
|
||||
}
|
||||
if(numberBytesData > 0)
|
||||
|
|
@ -725,7 +725,7 @@ int main() {
|
|||
}
|
||||
|
||||
const bool set = selection2 == '1';
|
||||
neoio_t type;
|
||||
neoio_t type = ICSNEO_IO_ETH_ACTIVATION;
|
||||
switch (selection)
|
||||
{
|
||||
case '1': type = ICSNEO_IO_ETH_ACTIVATION; break;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ void printAPIEvents() {
|
|||
void printDeviceEvents(neodevice_t* device) {
|
||||
neoevent_t events[99];
|
||||
size_t eventCount = 99;
|
||||
if(icsneo_getDeviceEvents(selectedDevice, events, &eventCount)) {
|
||||
if(icsneo_getDeviceEvents(device, events, &eventCount)) {
|
||||
if(eventCount == 1) {
|
||||
printf("1 device event found!\n");
|
||||
printf("Event 0x%x: %s\n", events[0].eventNumber, events[0].description);
|
||||
|
|
@ -155,7 +155,7 @@ char getCharInput(int numArgs, ...) {
|
|||
|
||||
char* list = (char*) calloc(numArgs, sizeof(char));
|
||||
for(int i = 0; i < numArgs; ++i) {
|
||||
*(list + i) = va_arg(vaList, int);
|
||||
*(list + i) = (char)va_arg(vaList, int);
|
||||
}
|
||||
|
||||
va_end(vaList);
|
||||
|
|
@ -335,8 +335,8 @@ int main() {
|
|||
case ICSNEO_NETWORK_TYPE_CAN: {
|
||||
neomessage_can_t* canMsg = (neomessage_can_t*)frame;
|
||||
printf("\t0x%03x [%zu] ", canMsg->arbid, canMsg->length);
|
||||
for(size_t i = 0; i < canMsg->length; i++) {
|
||||
printf("%02x ", canMsg->data[i]);
|
||||
for(size_t j = 0; i < canMsg->length; j++) {
|
||||
printf("%02x ", canMsg->data[j]);
|
||||
}
|
||||
if(canMsg->status.transmitMessage)
|
||||
printf("TX%s %04x ", canMsg->status.globalError ? " ERR" : "", canMsg->description);
|
||||
|
|
@ -347,8 +347,6 @@ int main() {
|
|||
neomessage_lin_t* linMsg = (neomessage_lin_t*)frame;
|
||||
size_t frameLen = linMsg->length;
|
||||
size_t dataLen = (frameLen > 2) ? (frameLen - 2) : 0;
|
||||
size_t numberBytesHeader = (dataLen > 1) ? 3 : 1;
|
||||
size_t numberBytesData = frameLen - numberBytesHeader;
|
||||
if(linMsg->netid == ICSNEO_NETID_LIN) {
|
||||
printf("LIN 1 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
|
|
@ -356,11 +354,11 @@ int main() {
|
|||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < dataLen; ++i) {
|
||||
if (i < 2) {
|
||||
printf("%02x ", linMsg->header[i+1]);
|
||||
for(size_t j = 0; j < dataLen; ++j) {
|
||||
if (j < 2) {
|
||||
printf("%02x ", linMsg->header[j+1]);
|
||||
} else {
|
||||
printf("%02x ", linMsg->data[i-2]);
|
||||
printf("%02x ", linMsg->data[j-2]);
|
||||
}
|
||||
}
|
||||
printf("| Checksum: 0x%02x\n", linMsg->checksum);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
static const uint8_t tdmModeToChannelNum(TDMMode mode) {
|
||||
static uint8_t tdmModeToChannelNum(TDMMode mode) {
|
||||
|
||||
switch(mode) {
|
||||
case TDMMode::TDM2:
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ extern void DLLExport icsneo_findAllDevices(neodevice_t* devices, size_t* count)
|
|||
*
|
||||
* See icsneo_findAllDevices() for information regarding the neodevice_t validity contract.
|
||||
*/
|
||||
extern void DLLExport icsneo_freeUnconnectedDevices();
|
||||
extern void DLLExport icsneo_freeUnconnectedDevices(void);
|
||||
|
||||
/**
|
||||
* \brief Convert a serial number in numerical format to its string representation.
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ void CDCACM::readTask() {
|
|||
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
||||
while(!isClosing() && !isDisconnected()) {
|
||||
fd_set rfds = {0};
|
||||
struct timeval tv = {0};
|
||||
struct timeval tv = {};
|
||||
FD_SET(fd, &rfds);
|
||||
tv.tv_usec = 50000; // 50ms
|
||||
::select(fd + 1, &rfds, NULL, NULL, &tv);
|
||||
|
|
@ -224,7 +224,7 @@ void CDCACM::writeTask() {
|
|||
if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
|
||||
// We filled the TX FIFO, use select to wait for it to become available again
|
||||
fd_set wfds = {0};
|
||||
struct timeval tv = {0};
|
||||
struct timeval tv = {};
|
||||
FD_SET(fd, &wfds);
|
||||
tv.tv_usec = 50000; // 50ms
|
||||
::select(fd + 1, nullptr, &wfds, nullptr, &tv);
|
||||
|
|
|
|||
Loading…
Reference in New Issue