glibc/glibc-dns-host-gcc5.patch
Carlos O'Donell 0457f649e3 Resolves: #902094, #1262040
* Wed Sep 16 2015 Mike FABIAN <mfabian@redhat.com> - 2.22.90-7
- Add the C.UTF-8 locale (#902094).

* Wed Sep 16 2015 Carlos O'Donell <carlos@systemhalted.org> - 2.22.90-6
- Fix GCC 5 and -Werror related build failures.
- Fix --install-langs bug which causes SIGABRT (#1262040).
2015-09-17 12:24:49 -04:00

33 lines
1.1 KiB
Diff

Index: glibc-2.22-193-g315267a/resolv/nss_dns/dns-host.c
===================================================================
--- glibc-2.22-193-g315267a.orig/resolv/nss_dns/dns-host.c
+++ glibc-2.22-193-g315267a/resolv/nss_dns/dns-host.c
@@ -79,6 +79,7 @@
#include <stddef.h>
#include <string.h>
#include <sys/syslog.h>
+#include <libc-internal.h>
#include "nsswitch.h"
@@ -561,10 +562,19 @@ addrsort (char **ap, int num)
num = MAX_NR_ADDRS;
for (i = 0; i < num; i++, p++)
{
+ 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
+ _res.nsort which is limited to MAXRESOLVSORT. This
+ is likely PR/59124 which is still not fixed. */
+ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Warray-bounds")
+#endif
for (j = 0 ; (unsigned)j < _res.nsort; j++)
if (_res.sort_list[j].addr.s_addr ==
(((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
break;
+ DIAG_POP_NEEDS_COMMENT
aval[i] = j;
if (needsort == 0 && i > 0 && j < aval[i-1])
needsort = i;