Skip to content

Commit 7d35851

Browse files
authored
build: fix sms-tool_q and tom_modem compilation with GCC 15 (#132)
1 parent 5a13141 commit 7d35851

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

application/sms-tool_q/src/sms_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void resetserial()
112112
close(port);
113113
}
114114

115-
static void timeout()
115+
static void timeout(int sig __attribute__((unused)))
116116
{
117117
fprintf(stderr,"No response from modem.\n");
118118
exit(2);

application/tom_modem/src/main.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ int run_op(PROFILE_T *profile, void *transport)
201201
return UNKNOWN_ERROR;
202202
}
203203

204-
static void clean_up()
204+
static void clean_up(int sig __attribute__((unused)))
205205
{
206206
dbg_msg("Clean up success");
207207

@@ -216,6 +216,16 @@ static void clean_up()
216216
#endif
217217
}
218218

219+
static void atexit_cleanup(void)
220+
{
221+
clean_up(0);
222+
}
223+
224+
static void signal_cleanup(int sig __attribute__((unused)))
225+
{
226+
clean_up(sig);
227+
}
228+
219229
int main(int argc, char *argv[])
220230
{
221231
PROFILE_T *profile = &s_profile;
@@ -229,9 +239,9 @@ int main(int argc, char *argv[])
229239
}
230240

231241
// Setup cleanup and signal handlers
232-
atexit(clean_up);
233-
signal(SIGINT, clean_up);
234-
signal(SIGTERM, clean_up);
242+
atexit(atexit_cleanup);
243+
signal(SIGINT, signal_cleanup);
244+
signal(SIGTERM, signal_cleanup);
235245

236246
#ifdef USE_SEMAPHORE
237247
if (profile->op == CLEANUP_SEMAPHORE_OP)

0 commit comments

Comments
 (0)