Carlos O'Donell 0457f6
Index: glibc-2.22-193-g315267a/posix/bug-regex11.c
Carlos O'Donell 0457f6
===================================================================
Carlos O'Donell 0457f6
--- glibc-2.22-193-g315267a.orig/posix/bug-regex11.c
Carlos O'Donell 0457f6
+++ glibc-2.22-193-g315267a/posix/bug-regex11.c
Carlos O'Donell 0457f6
@@ -22,6 +22,7 @@
Carlos O'Donell 0457f6
 #include <regex.h>
Carlos O'Donell 0457f6
 #include <stdio.h>
Carlos O'Donell 0457f6
 #include <stdlib.h>
Carlos O'Donell 0457f6
+#include <libc-internal.h>
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
 /* Tests supposed to match.  */
Carlos O'Donell 0457f6
 struct
Carlos O'Donell 0457f6
@@ -119,6 +120,14 @@ main (void)
Carlos O'Donell 0457f6
 	  continue;
Carlos O'Donell 0457f6
 	}
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
+      DIAG_PUSH_NEEDS_COMMENT
Carlos O'Donell 0457f6
+#if __GNUC_PREREQ (5, 0)
Carlos O'Donell 0457f6
+      /* GCC 5.0 warns about array subscript being above array bounds,
Carlos O'Donell 0457f6
+	 but that's not entirely possible since n is limited to
Carlos O'Donell 0457f6
+	 static nmatch which is limited to at most 5 (see tests above).
Carlos O'Donell 0457f6
+	 This is likely PR/59124 which is still not fixed.  */
Carlos O'Donell 0457f6
+      DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds")
Carlos O'Donell 0457f6
+#endif
Carlos O'Donell 0457f6
       for (n = 0; n < tests[i].nmatch; ++n)
Carlos O'Donell 0457f6
 	if (rm[n].rm_so != tests[i].rm[n].rm_so
Carlos O'Donell 0457f6
               || rm[n].rm_eo != tests[i].rm[n].rm_eo)
Carlos O'Donell 0457f6
@@ -130,6 +139,7 @@ main (void)
Carlos O'Donell 0457f6
 	    ret = 1;
Carlos O'Donell 0457f6
 	    break;
Carlos O'Donell 0457f6
 	  }
Carlos O'Donell 0457f6
+      DIAG_POP_NEEDS_COMMENT
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
       regfree (&re);
Carlos O'Donell 0457f6
     }
Carlos O'Donell 0457f6
Index: glibc-2.22-193-g315267a/posix/bug-regex17.c
Carlos O'Donell 0457f6
===================================================================
Carlos O'Donell 0457f6
--- glibc-2.22-193-g315267a.orig/posix/bug-regex17.c
Carlos O'Donell 0457f6
+++ glibc-2.22-193-g315267a/posix/bug-regex17.c
Carlos O'Donell 0457f6
@@ -23,6 +23,7 @@
Carlos O'Donell 0457f6
 #include <stdio.h>
Carlos O'Donell 0457f6
 #include <stdlib.h>
Carlos O'Donell 0457f6
 #include <locale.h>
Carlos O'Donell 0457f6
+#include <libc-internal.h>
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
 /* Tests supposed to match.  */
Carlos O'Donell 0457f6
 struct
Carlos O'Donell 0457f6
@@ -87,6 +88,14 @@ do_test (void)
Carlos O'Donell 0457f6
 	  continue;
Carlos O'Donell 0457f6
 	}
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
+      DIAG_PUSH_NEEDS_COMMENT
Carlos O'Donell 0457f6
+#if __GNUC_PREREQ (5, 0)
Carlos O'Donell 0457f6
+      /* GCC 5.0 warns about array subscript being above array bounds,
Carlos O'Donell 0457f6
+	 but that's not entirely possible since n is limited to
Carlos O'Donell 0457f6
+	 static nmatch which is limited to at most 5 (see tests above).
Carlos O'Donell 0457f6
+	 This is likely PR/59124 which is still not fixed.  */
Carlos O'Donell 0457f6
+      DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds")
Carlos O'Donell 0457f6
+#endif
Carlos O'Donell 0457f6
       for (n = 0; n < tests[i].nmatch; ++n)
Carlos O'Donell 0457f6
 	if (rm[n].rm_so != tests[i].rm[n].rm_so
Carlos O'Donell 0457f6
               || rm[n].rm_eo != tests[i].rm[n].rm_eo)
Carlos O'Donell 0457f6
@@ -98,6 +107,7 @@ do_test (void)
Carlos O'Donell 0457f6
 	    ret = 1;
Carlos O'Donell 0457f6
 	    break;
Carlos O'Donell 0457f6
 	  }
Carlos O'Donell 0457f6
+      DIAG_POP_NEEDS_COMMENT
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
       regfree (&re);
Carlos O'Donell 0457f6
     }
Carlos O'Donell 0457f6
Index: glibc-2.22-193-g315267a/posix/bug-regex18.c
Carlos O'Donell 0457f6
===================================================================
Carlos O'Donell 0457f6
--- glibc-2.22-193-g315267a.orig/posix/bug-regex18.c
Carlos O'Donell 0457f6
+++ glibc-2.22-193-g315267a/posix/bug-regex18.c
Carlos O'Donell 0457f6
@@ -23,6 +23,7 @@
Carlos O'Donell 0457f6
 #include <stdio.h>
Carlos O'Donell 0457f6
 #include <stdlib.h>
Carlos O'Donell 0457f6
 #include <locale.h>
Carlos O'Donell 0457f6
+#include <libc-internal.h>
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
 /* Tests supposed to match.  */
Carlos O'Donell 0457f6
 struct
Carlos O'Donell 0457f6
@@ -80,6 +81,14 @@ main (void)
Carlos O'Donell 0457f6
 	  continue;
Carlos O'Donell 0457f6
 	}
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
+      DIAG_PUSH_NEEDS_COMMENT
Carlos O'Donell 0457f6
+#if __GNUC_PREREQ (5, 0)
Carlos O'Donell 0457f6
+      /* GCC 5.0 warns about array subscript being above array bounds,
Carlos O'Donell 0457f6
+	 but that's not entirely possible since n is limited to
Carlos O'Donell 0457f6
+	 static nmatch which is limited to at most 5 (see tests above).
Carlos O'Donell 0457f6
+	 This is likely PR/59124 which is still not fixed.  */
Carlos O'Donell 0457f6
+      DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds")
Carlos O'Donell 0457f6
+#endif
Carlos O'Donell 0457f6
       for (n = 0; n < tests[i].nmatch; ++n)
Carlos O'Donell 0457f6
 	if (rm[n].rm_so != tests[i].rm[n].rm_so
Carlos O'Donell 0457f6
               || rm[n].rm_eo != tests[i].rm[n].rm_eo)
Carlos O'Donell 0457f6
@@ -91,6 +100,7 @@ main (void)
Carlos O'Donell 0457f6
 	    ret = 1;
Carlos O'Donell 0457f6
 	    break;
Carlos O'Donell 0457f6
 	  }
Carlos O'Donell 0457f6
+      DIAG_POP_NEEDS_COMMENT
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
       regfree (&re);
Carlos O'Donell 0457f6
     }
Carlos O'Donell 0457f6
Index: glibc-2.22-193-g315267a/posix/bug-regex30.c
Carlos O'Donell 0457f6
===================================================================
Carlos O'Donell 0457f6
--- glibc-2.22-193-g315267a.orig/posix/bug-regex30.c
Carlos O'Donell 0457f6
+++ glibc-2.22-193-g315267a/posix/bug-regex30.c
Carlos O'Donell 0457f6
@@ -23,6 +23,7 @@
Carlos O'Donell 0457f6
 #include <stdio.h>
Carlos O'Donell 0457f6
 #include <stdlib.h>
Carlos O'Donell 0457f6
 #include <locale.h>
Carlos O'Donell 0457f6
+#include <libc-internal.h>
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
 /* Tests supposed to match.  */
Carlos O'Donell 0457f6
 struct
Carlos O'Donell 0457f6
@@ -80,6 +81,14 @@ do_test (void)
Carlos O'Donell 0457f6
 	  continue;
Carlos O'Donell 0457f6
 	}
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
+      DIAG_PUSH_NEEDS_COMMENT
Carlos O'Donell 0457f6
+#if __GNUC_PREREQ (5, 0)
Carlos O'Donell 0457f6
+      /* GCC 5.0 warns about array subscript being above array bounds,
Carlos O'Donell 0457f6
+	 but that's not entirely possible since n is limited to
Carlos O'Donell 0457f6
+	 static nmatch which is limited to at most 5 (see tests above).
Carlos O'Donell 0457f6
+	 This is likely PR/59124 which is still not fixed.  */
Carlos O'Donell 0457f6
+      DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds")
Carlos O'Donell 0457f6
+#endif
Carlos O'Donell 0457f6
       for (n = 0; n < tests[i].nmatch; ++n)
Carlos O'Donell 0457f6
 	if (rm[n].rm_so != tests[i].rm[n].rm_so
Carlos O'Donell 0457f6
 	      || rm[n].rm_eo != tests[i].rm[n].rm_eo)
Carlos O'Donell 0457f6
@@ -91,6 +100,7 @@ do_test (void)
Carlos O'Donell 0457f6
 	    ret = 1;
Carlos O'Donell 0457f6
 	    break;
Carlos O'Donell 0457f6
 	  }
Carlos O'Donell 0457f6
+      DIAG_POP_NEEDS_COMMENT
Carlos O'Donell 0457f6
 
Carlos O'Donell 0457f6
       regfree (&re);
Carlos O'Donell 0457f6
     }