Skip to content

Commit

Permalink
Merge pull request #261 from LSTS/maintenance/remove_warnings_compila…
Browse files Browse the repository at this point in the history
…tion

Maintenance/remove warnings compilation
  • Loading branch information
luis109 authored Nov 26, 2024
2 parents a403597 + aae003a commit e7e5203
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ install(FILES ${DUNE_GENERATED}/src/DUNE/Config.hpp

include(${PROJECT_SOURCE_DIR}/cmake/Version.cmake)

message(STATUS "")
message(STATUS "******************************************")
message(STATUS "*** Compiler Flags ***")
message(STATUS "******************************************")

message(STATUS "Adding: -Wno-cpp")
set(DUNE_CXX_FLAGS "${DUNE_CXX_FLAGS} -Wno-cpp")
set(DUNE_C_FLAGS "${DUNE_C_FLAGS} -Wno-cpp")

message(STATUS "DUNE_CXX_FLAGS: ${DUNE_CXX_FLAGS}")
message(STATUS "DUNE_C_FLAGS: ${DUNE_C_FLAGS}")

set_source_files_properties(${DUNE_CORE_SOURCES} ${USER_CORE_SOURCES} ${PRIVATE_CORE_SOURCES}
PROPERTIES COMPILE_FLAGS "${DUNE_CXX_FLAGS} ${DUNE_CXX_FLAGS_STRICT}")

Expand Down
9 changes: 5 additions & 4 deletions src/DUNE/Hardware/SocketCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace DUNE
throw Error("Frame type not recognized", System::Error::getLastMessage());
}

std::strncpy(m_ifr.ifr_name, can_dev.c_str(), IFNAMSIZ);
std::strncpy(m_ifr.ifr_name, can_dev.c_str(), IFNAMSIZ - 1);


if(::ioctl(m_can_socket, SIOCGIFFLAGS, &m_ifr) < 0) {
Expand Down Expand Up @@ -171,22 +171,23 @@ namespace DUNE
size_t
SocketCAN::doWrite(const uint8_t* bfr, size_t size) { // TODO: Add exceptions
#if defined(DUNE_OS_LINUX)
ssize_t bytes_written;
switch(can_frame_type) {
case CAN_BASIC_SFF:
case CAN_BASIC_EFF:
struct can_frame frame;
frame.can_dlc = size;
frame.can_id = cantxid;
memcpy(frame.data, bfr, size);
bytes_written = ::write(m_can_socket, &frame, CAN_MTU);
if (::write(m_can_socket, &frame, CAN_MTU) == -1)
throw Error("Write failed", System::Error::getLastMessage());
break;
case CAN_FD:
struct canfd_frame fdframe;
fdframe.len = size;
fdframe.can_id = cantxid;
memcpy(fdframe.data, bfr, size);
bytes_written = ::write(m_can_socket, &fdframe, CANFD_MTU);
if (::write(m_can_socket, &fdframe, CANFD_MTU) == -1)
throw Error("Write failed", System::Error::getLastMessage());
break;
default:
throw Error("Frame type not recognized", System::Error::getLastMessage());
Expand Down
4 changes: 3 additions & 1 deletion vendor/libraries/jpeg/jcmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ prepare_for_pass (j_compress_ptr cinfo)
break;
#ifdef ENTROPY_OPT_SUPPORTED
case huff_opt_pass:
#endif
case output_pass:
#ifdef ENTROPY_OPT_SUPPORTED
/* Do Huffman optimization for a scan after the first one. */
select_scan_parameters(cinfo);
per_scan_setup(cinfo);
Expand All @@ -690,7 +693,6 @@ prepare_for_pass (j_compress_ptr cinfo)
master->pass_number++;
/*FALLTHROUGH*/
#endif
case output_pass:
/* Do a data-output pass. */
/* We need not repeat per-scan setup if prior optimization pass did it. */
if (! cinfo->optimize_coding) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/libraries/jpeg/jdarith.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;

p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
m1 = ((unsigned int) -1) << cinfo->Al; /* -1 in the bit position being coded */

/* Establish EOBx (previous stage end-of-block) index */
for (kex = cinfo->Se; kex > 0; kex--)
Expand Down
2 changes: 1 addition & 1 deletion vendor/libraries/jpeg/jdhuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)

Se = cinfo->Se;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
m1 = ((unsigned int) -1) << cinfo->Al; /* -1 in the bit position being coded */
natural_order = cinfo->natural_order;

/* Load up working state */
Expand Down

0 comments on commit e7e5203

Please sign in to comment.