Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ add_compile_options(
-Wcast-qual
-Wno-system-headers
-Wno-unused-function
-Wno-stringop-truncation
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:Clang>>:-Wno-gnu-statement-expression-from-macro-expansion>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need rechecking for bounded cross-toolchain, see:

if(WITH_DLT_QNX_SYSTEM AND NOT "${CMAKE_C_COMPILER}" MATCHES "nto-qnx|qcc|ntoaarch64-gcc|ntox86_64-gcc")

(shall pattern like clang/clang++ must be added?)

$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Clang>>:-Wno-gnu-statement-expression-from-macro-expansion>
$<$<CXX_COMPILER_ID:Clang>:-Wno-gnu-zero-variadic-macro-arguments>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:GNU>>:-Wno-stringop-truncation>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-Wno-stringop-truncation>
)

if(WITH_DOC STREQUAL "OFF")
Expand Down
2 changes: 1 addition & 1 deletion examples/example1/example1.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

DLT_DECLARE_CONTEXT(con_exa1)

int main()
int main(void)
{
struct timespec ts;

Expand Down
2 changes: 1 addition & 1 deletion examples/example1_v2/example1.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

DLT_DECLARE_CONTEXT(con_exa1);

int main()
int main(void)
{
struct timespec ts;

Expand Down
2 changes: 1 addition & 1 deletion examples/example2/example2.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

DLT_DECLARE_CONTEXT(con_exa2)

int main()
int main(void)
{
int num;
struct timespec ts;
Expand Down
2 changes: 1 addition & 1 deletion examples/example2_v2/example2.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

DLT_DECLARE_CONTEXT(con_exa2);

int main()
int main(void)
{
int num;
struct timespec ts;
Expand Down
2 changes: 1 addition & 1 deletion examples/example3/example3.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

DLT_DECLARE_CONTEXT(con_exa3)

int main()
int main(void)
{
int num;
struct timespec ts;
Expand Down
2 changes: 1 addition & 1 deletion examples/example3_v2/example3.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

DLT_DECLARE_CONTEXT(con_exa3);

int main()
int main(void)
{
int num;
struct timespec ts;
Expand Down
2 changes: 1 addition & 1 deletion examples/example4/example4.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

DLT_DECLARE_CONTEXT(con_exa1)

int main()
int main(void)
{
unsigned char buffer[256];
int num;
Expand Down
2 changes: 1 addition & 1 deletion examples/example4_v2/example4.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

DLT_DECLARE_CONTEXT(con_exa1);

int main()
int main(void)
{
unsigned char buffer[256];
int num;
Expand Down
2 changes: 1 addition & 1 deletion src/console/dlt-control-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ typedef struct {
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
8 changes: 4 additions & 4 deletions src/console/dlt-passive-node-ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void set_node_id(char *id)
}
}

char *get_node_id()
char *get_node_id(void)
{
return g_options.node_id;
}
Expand Down Expand Up @@ -211,7 +211,7 @@ static int dlt_passive_node_analyze_response(char *answer,
*
* @return Pointer ot DltControlMsgBody, NULL otherwise
*/
DltControlMsgBody *dlt_passive_node_prepare_message_body()
DltControlMsgBody *dlt_passive_node_prepare_message_body(void)
{
DltControlMsgBody *mb = calloc(1, sizeof(DltControlMsgBody));
char *ecuid = get_node_id();
Expand Down Expand Up @@ -271,7 +271,7 @@ void dlt_passive_node_destroy_message_body(DltControlMsgBody *msg_body)
*
* @return 0 on success, -1 on error
*/
static int dlt_passive_node_ctrl_single_request()
static int dlt_passive_node_ctrl_single_request(void)
{
int ret = -1;

Expand Down Expand Up @@ -301,7 +301,7 @@ static int dlt_passive_node_ctrl_single_request()
return ret;
}

static void usage()
static void usage(void)
{
printf("Usage: dlt-passive-node-ctrl [options]\n");
printf("Send a trigger to DLT daemon to (dis)connect a passive node "
Expand Down
2 changes: 1 addition & 1 deletion src/console/dlt-receive-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ typedef struct {
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
2 changes: 1 addition & 1 deletion src/console/dlt-sortbytimestamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void write_messages(int ohandle, DltFile *file,
/**
* Print usage information of tool.
*/
void usage() {
void usage(void) {
char version[DLT_VERBUFSIZE];

dlt_get_version(version, DLT_VERBUFSIZE);
Expand Down
2 changes: 1 addition & 1 deletion src/console/logstorage/dlt-logstorage-ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ static int dlt_logstorage_ctrl_setup_event_loop(void)
*
* @return 0 on success, -1 otherwise.
*/
static int dlt_logstorage_ctrl_single_request()
static int dlt_logstorage_ctrl_single_request(void)
{
int ret = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/daemon/dlt-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void close_pipes(int fds[2])
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[DLT_DAEMON_TEXTBUFSIZE];
dlt_get_version(version, DLT_DAEMON_TEXTBUFSIZE);
Expand Down Expand Up @@ -2490,7 +2490,7 @@ void dlt_daemon_local_cleanup(DltDaemon *daemon, DltDaemonLocal *daemon_local, i
free(daemon_local->flags.ipNodes);
}

void dlt_daemon_exit_trigger()
void dlt_daemon_exit_trigger(void)
{
/* stop event loop */
g_exit = -1;
Expand Down Expand Up @@ -2656,7 +2656,7 @@ int dlt_daemon_log_internal(DltDaemon *daemon, DltDaemonLocal *daemon_local,

msg.storageheadersizev2 = (uint32_t)(STORAGE_HEADER_V2_FIXED_SIZE + strlen(DLT_DAEMON_ECU_ID));
msg.baseheadersizev2 = BASE_HEADER_V2_FIXED_SIZE;
msg.baseheaderextrasizev2 = (int32_t)dlt_message_get_extraparameters_size_v2(msgcontent);
msg.baseheaderextrasizev2 = (uint32_t)dlt_message_get_extraparameters_size_v2(msgcontent);
/* Ecu Id, App Id, Ctx Id and Session Id*/
msg.extendedheadersizev2 = (uint32_t)(1 + strlen(DLT_DAEMON_ECU_ID) + 1 + strlen(app_id) + 1 + strlen(ctx_id) + sizeof(uint32_t));

Expand Down
2 changes: 1 addition & 1 deletion src/daemon/dlt-daemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ int dlt_daemon_local_connection_init(DltDaemon *daemon, DltDaemonLocal *daemon_l
int dlt_daemon_local_ecu_version_init(DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);

void dlt_daemon_daemonize(int verbose);
void dlt_daemon_exit_trigger();
void dlt_daemon_exit_trigger(void);
void dlt_daemon_signal_handler(int sig);
#ifdef __QNX__
void dlt_daemon_cleanup_timers();
Expand Down
6 changes: 3 additions & 3 deletions src/daemon/dlt_daemon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ int dlt_daemon_client_send_control_message_v2(int sock,

msg->storageheadersizev2 = (uint32_t)(STORAGE_HEADER_V2_FIXED_SIZE + (daemon->ecuid2len));
msg->baseheadersizev2 = BASE_HEADER_V2_FIXED_SIZE;
msg->baseheaderextrasizev2 = (int32_t)dlt_message_get_extraparameters_size_v2(DLT_CONTROL_MSG);
msg->baseheaderextrasizev2 = (uint32_t)dlt_message_get_extraparameters_size_v2(DLT_CONTROL_MSG);
msg->extendedheadersizev2 = (uint32_t)((daemon->ecuid2len) + 1 + appidlen + 1 + ctxidlen + 1);

msg->headersizev2 = (int32_t)(msg->storageheadersizev2 + msg->baseheadersizev2 +
Expand Down Expand Up @@ -5388,7 +5388,7 @@ void dlt_daemon_control_passive_node_connect_status_v2(int sock,

con = &daemon_local->pGateway.connections[i];

resp->connection_status[i] = con->status;
resp->connection_status[i] = (uint8_t)con->status;
//TBD: Review node_id[i * con->ecuid2len]
memcpy(&resp->node_id[i * con->ecuid2len], con->ecuid2, con->ecuid2len);
}
Expand Down Expand Up @@ -5471,7 +5471,7 @@ void dlt_daemon_control_passive_node_connect_status(int sock,

con = &daemon_local->pGateway.connections[i];

resp->connection_status[i] = con->status;
resp->connection_status[i] = (uint8_t)con->status;
memcpy(&resp->node_id[i * DLT_ID_SIZE], con->ecuid, DLT_ID_SIZE);
}

Expand Down
8 changes: 5 additions & 3 deletions src/examples/dlt-example-filetransfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ bool shutdownStatus = false;
* The function will set the flag (shutdownStatus) to true after .2 sec
* @return Null to stop thread
*/
void *cancel_filetransfer()
void *cancel_filetransfer(void* arg)
{
// wait 200msec once a filetransfer is started and then set the flag to true
(void)arg;
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 200000000; // 200 ms
Expand All @@ -99,8 +100,9 @@ void *cancel_filetransfer()
* The function will start dlt filetransfer and will throw error if status of shutdownStatus is high
* @return Null to stop thread
*/
void *filetransfer()
void *filetransfer(void* arg)
{
(void)arg;
int transferResult;

transferResult = dlt_user_log_file_header(&fileContext, file);
Expand All @@ -125,7 +127,7 @@ void *filetransfer()
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
4 changes: 2 additions & 2 deletions src/examples/dlt-example-multicast-clientmsg-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int dlt_receive_message_callback_udp(DltMessage *message)
{
static char text[DLT_RECEIVE_TEXTBUFSIZE];

if ((message == NULL)) {
if (message == NULL) {
printf("NULL message in dlt_receive_message_callback_udp\n");
return -1;
}
Expand All @@ -119,7 +119,7 @@ int dlt_receive_message_callback_udp(DltMessage *message)
}


int main()
int main(void)
{
struct clientinfostruct clientinfo;
struct ip_mreq mreq;
Expand Down
2 changes: 1 addition & 1 deletion src/examples/dlt-example-user-common-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ DLT_DECLARE_CONTEXT(mycontext)
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
2 changes: 1 addition & 1 deletion src/examples/dlt-example-user-func-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ DltContextData mycontextdata;
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
2 changes: 1 addition & 1 deletion src/examples/dlt-example-user-func.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DltContextData mycontextdata;
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
4 changes: 2 additions & 2 deletions src/examples/dlt-example-user-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ DLT_DECLARE_CONTEXT(mycontext3)
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down Expand Up @@ -458,4 +458,4 @@ int dlt_user_injection_callback_with_specific_data(uint32_t service_id, void *da
void dlt_user_log_level_changed_callback_v2(char *context_id, uint8_t log_level, uint8_t trace_status)
{
printf("Log level changed of context %s, LogLevel=%u, TraceState=%u\n", context_id, log_level, trace_status);
}
}
2 changes: 1 addition & 1 deletion src/examples/dlt-example-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ DLT_DECLARE_CONTEXT(mycontext3)
/**
* Print usage information of tool.
*/
void usage()
void usage(void)
{
char version[255];

Expand Down
3 changes: 2 additions & 1 deletion src/lib/dlt_env_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ int dlt_env_helper_to_lower(char **const env, char *result, int const res_len)

int dlt_env_extract_symbolic_ll(char **const env, int8_t *ll)
{
char result[strlen("verbose") + 1];
char result[sizeof("verbose")];


if (!env || !ll) {
return -1;
Expand Down
Loading
Loading