Skip to content

Commit c7a4f6b

Browse files
committed
net: lib: dns: Replace pragma with TOOLCHAIN_DISABLE macro
These macros were recently introduced and replaced everywhere (#84065), but this was missed. Signed-off-by: Tom Hughes <[email protected]>
1 parent a117d12 commit c7a4f6b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

include/zephyr/toolchain/gcc.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ do { \
693693

694694
/* GCC-specific warnings that aren't in clang. */
695695
#if defined(__GNUC__) && !defined(__clang__)
696-
#define TOOLCHAIN_WARNING_POINTER_ARITH "-Wpointer-arith"
696+
#define TOOLCHAIN_WARNING_POINTER_ARITH "-Wpointer-arith"
697+
#define TOOLCHAIN_WARNING_STRINGOP_OVERREAD "-Wstringop-overread"
697698
#endif
698699

699700
#define _TOOLCHAIN_DISABLE_WARNING(compiler, warning) \

subsys/net/lib/dns/mdns_responder.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ LOG_MODULE_REGISTER(net_mdns_responder, CONFIG_MDNS_RESPONDER_LOG_LEVEL);
4444
* address-family-specific variants being of differing sizes. Let's not
4545
* mess with code (which looks correct), just silence the compiler.
4646
*/
47-
#ifdef __GNUC__
48-
#pragma GCC diagnostic ignored "-Wpragmas"
49-
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
50-
#pragma GCC diagnostic ignored "-Warray-bounds"
51-
#pragma GCC diagnostic ignored "-Wstringop-overread"
52-
#endif
47+
TOOLCHAIN_DISABLE_GCC_WARNING(TOOLCHAIN_WARNING_ARRAY_BOUNDS);
48+
TOOLCHAIN_DISABLE_GCC_WARNING(TOOLCHAIN_WARNING_STRINGOP_OVERREAD);
5349

5450
extern void dns_dispatcher_svc_handler(struct net_socket_service_event *pev);
5551

0 commit comments

Comments
 (0)