Index: glibc-2.22-386-g95e8397/resolv/res_hconf.c =================================================================== --- glibc-2.22-386-g95e8397.orig/resolv/res_hconf.c +++ glibc-2.22-386-g95e8397/resolv/res_hconf.c @@ -46,6 +46,7 @@ #include "res_hconf.h" #include #include +#include #if IS_IN (libc) # define fgets_unlocked __fgets_unlocked @@ -577,7 +578,16 @@ _res_hconf_trim_domain (char *hostname) for (i = 0; i < _res_hconf.num_trimdomains; ++i) { + DIAG_PUSH_NEEDS_COMMENT +#if __GNUC_PREREQ (5, 0) + /* GCC 5.0 warns about array subscript being above array bounds, + but that's not entirely possible since i is limited to + num_trimdomains which is limited to <= TRIMDOMAINS_MAX. This + is likely PR/59124 which is still not fixed. */ + DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds") +#endif const char *trim = _res_hconf.trimdomain[i]; + DIAG_POP_NEEDS_COMMENT trim_len = strlen (trim); if (hostname_len > trim_len