Skip to content

Commit 2474909

Browse files
Marcel Heckohecko
authored andcommitted
Fix warnings reported by GCC on RHEL 7/8/9/10
- Reorder constructor initializer list in SipCtrlInterface to match member declaration order, fixing -Wreorder on all RHEL versions - Add GCC version check (__GNUC__ >= 8) for -Wclass-memaccess pragma in sip_parser_async.h, fixing -Wpragmas on RHEL 7 (GCC 4.8) - Fix format specifier in codec2.c: %s -> %d for int argument, fixing -Wformat and a runtime bug on all platforms
1 parent af3ef48 commit 2474909

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

core/SipCtrlInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ int _SipCtrlInterface::load()
256256
}
257257

258258
_SipCtrlInterface::_SipCtrlInterface()
259-
: on_idle_cb(NULL),
260-
stopped(false),
259+
: stopped(false),
260+
on_idle_cb(NULL),
261261
nr_udp_sockets(0), udp_sockets(NULL),
262262
nr_udp_servers(0), udp_servers(NULL),
263263
nr_tcp_sockets(0), tcp_sockets(NULL),

core/SipCtrlInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class _SipCtrlInterface:
6363
friend class udp_trsp;
6464

6565
AmCondition<bool> stopped;
66-
66+
6767
unsigned short nr_udp_sockets;
6868
udp_trsp_socket** udp_sockets;
6969

core/plug-in/codec2/codec2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ long sems_codec2_create(const int bps,
9898
} else if (bps == 1400) {
9999
mode = CODEC2_MODE_1400;
100100
} else {
101-
ERROR("Error in mode: %s\n", bps);
101+
ERROR("Error in mode: %d\n", bps);
102102
ERROR("Mode must be 3200, 2400, 1600 or 1400\n");
103103
free(c2enc);
104104
return -1;

core/sip/sip_parser_async.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct parser_state
3030

3131
void reset_hdr_parser() {
3232
#pragma GCC diagnostic push
33-
#if defined(__GNUC__) && !defined(__clang__)
33+
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 8)
3434
#pragma GCC diagnostic ignored "-Wclass-memaccess"
3535
#endif
3636
memset(&hdr,0,sizeof(sip_header));

0 commit comments

Comments
 (0)