Skip to content

Commit 55003eb

Browse files
committed
Ignore nonnull-compare in one edge case of GNU strcasestr impl
1 parent e2fc4b0 commit 55003eb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

c89stringutils/c89stringutils_string_extras.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
#include <limits.h> /* for INT_MAX */
1616
/* clang-format on */
1717

18+
#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__clang__)
19+
#pragma GCC diagnostic push
20+
#pragma GCC diagnostic ignored "-Wnonnull-compare"
21+
#endif
22+
1823
void c89stringutils_log_debug(const char *fmt, ...) {
1924
int rc;
2025
va_list args;
@@ -416,3 +421,7 @@ char *jasprintf(char **unto, const char *fmt, ...) {
416421
return result;
417422
}
418423
#endif /* !HAVE_JASPRINTF */
424+
425+
#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__clang__)
426+
#pragma GCC diagnostic pop
427+
#endif

0 commit comments

Comments
 (0)