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