Skip to content

Commit 78f1c3f

Browse files
Turn off fake warnings in LeaMDNS
1 parent 243445d commit 78f1c3f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libraries/LEAmDNS/src/LEAmDNS_Structs.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
#include "LEAmDNS_Priv.h"
2727
#include "LEAmDNS_lwIPdefs.h"
2828

29+
// There are many strncpy()s here that immediately set the terminating \0, but GCC
30+
// doesn't notice that and emits a warning at -O3 -Wall -Wextra. After inspection,
31+
// disable that specific warning since it's not a real problem
32+
33+
#pragma GCC diagnostic push
34+
#pragma GCC diagnostic ignored "-Wstringop-truncation"
35+
2936
namespace esp8266 {
3037

3138
/*
@@ -2020,3 +2027,5 @@ MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostn
20202027
} // namespace MDNSImplementation
20212028

20222029
} // namespace esp8266
2030+
2031+
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)