Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/gcc9 lang/gcc9: fix build with -Werror=char-subsc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f9bde6aeb1a7
branches:  trunk
changeset: 431982:f9bde6aeb1a7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun May 17 22:36:07 2020 +0000

description:
lang/gcc9: fix build with -Werror=char-subscripts

diffstat:

 lang/gcc9/Makefile                                           |   4 +-
 lang/gcc9/distinfo                                           |   8 +-
 lang/gcc9/patches/patch-libgfortran_io_format.c              |  17 ++++
 lang/gcc9/patches/patch-libgfortran_io_list__read.c          |  17 ++++
 lang/gcc9/patches/patch-libgfortran_io_read.c                |  44 ++++++++++++
 lang/gcc9/patches/patch-libgfortran_runtime_environ.c        |  26 +++++++
 lang/gcc9/patches/patch-libquadmath_printf_quadmath-printf.c |  26 +++++++
 lang/gcc9/patches/patch-libquadmath_strtod_strtod__l.c       |  23 ++++++
 8 files changed, 162 insertions(+), 3 deletions(-)

diffs (214 lines):

diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/Makefile
--- a/lang/gcc9/Makefile        Sun May 17 22:16:40 2020 +0000
+++ b/lang/gcc9/Makefile        Sun May 17 22:36:07 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.20 2020/05/09 18:03:58 rillig Exp $
+# $NetBSD: Makefile,v 1.21 2020/05/17 22:36:07 rillig Exp $
 
 GCC9_VERSION=  9.3.0
-PKGREVISION=   1
+PKGREVISION=   2
 
 DISTNAME=      gcc-${GCC9_VERSION}
 PKGNAME=       gcc9-${GCC9_VERSION}
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/distinfo
--- a/lang/gcc9/distinfo        Sun May 17 22:16:40 2020 +0000
+++ b/lang/gcc9/distinfo        Sun May 17 22:36:07 2020 +0000
@@ -1,13 +1,19 @@
-$NetBSD: distinfo,v 1.4 2020/04/20 14:25:52 bsiegert Exp $
+$NetBSD: distinfo,v 1.5 2020/05/17 22:36:07 rillig Exp $
 
 SHA1 (gcc-9.3.0.tar.xz) = b746688bf045a316fc92c3528138ad10d0822b6b
 RMD160 (gcc-9.3.0.tar.xz) = e0ade31726b8fbb1eb308e2b1383a79633aef996
 SHA512 (gcc-9.3.0.tar.xz) = 4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de
 Size (gcc-9.3.0.tar.xz) = 70533868 bytes
 SHA1 (patch-gcc_gimplify.c) = f933a033d4a6c11fa82c8c9c6785842ba7993862
+SHA1 (patch-libgfortran_io_format.c) = 9bbc5e4f6277bdec785b3690fd08259939a2aa1a
+SHA1 (patch-libgfortran_io_list__read.c) = 589cdb8dcd180b781ededc086e8775224fca5779
+SHA1 (patch-libgfortran_io_read.c) = cf21493396d07a5e8ad0dfb70a8d25a11482fc98
+SHA1 (patch-libgfortran_runtime_environ.c) = c7217704a00f4c0314bbc1838ac6fc966cc854d0
 SHA1 (patch-libgo_go_runtime_os__netbsd.go) = 357c62afe017a5ca3d7138abb2c19dc10bc5cd3d
 SHA1 (patch-libgo_go_runtime_signal__gccgo.go) = 51b632c1c827f6d99fc2d7803294a0b7a64514a1
 SHA1 (patch-libgo_go_runtime_stubs.go) = f4753765eb7ee9a933f2bb3a05f27c487a1d51ef
 SHA1 (patch-libgo_runtime_go-signal.c) = 6121b041cdd850adeea943f385d52b65d6bfe249
+SHA1 (patch-libquadmath_printf_quadmath-printf.c) = 78e09f1e6d61ee57cee83275093cf46b2335d204
+SHA1 (patch-libquadmath_strtod_strtod__l.c) = 6142c10d34174174cce7f06c37eab04dc431b2dc
 SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = f12f6a97f94d13efa73a2500411bc77b27887edd
 SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__configure__char.cc) = 007bce70f75deace18f60924b5a3f94bf7a0af2f
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/patches/patch-libgfortran_io_format.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc9/patches/patch-libgfortran_io_format.c   Sun May 17 22:36:07 2020 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-libgfortran_io_format.c,v 1.1 2020/05/17 22:36:07 rillig Exp $
+
+Fix -Werror=char-subscripts.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
+
+--- libgfortran/io/format.c.orig       2020-05-07 10:50:02.000000000 +0000
++++ libgfortran/io/format.c
+@@ -193,7 +193,7 @@ next_char (format_data *fmt, int literal
+       return -1;
+ 
+       fmt->format_string_len--;
+-      c = toupper (*fmt->format_string++);
++      c = toupper ((unsigned char) *fmt->format_string++);
+       fmt->error_element = c;
+     }
+   while ((c == ' ' || c == '\t') && !literal);
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/patches/patch-libgfortran_io_list__read.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc9/patches/patch-libgfortran_io_list__read.c       Sun May 17 22:36:07 2020 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-libgfortran_io_list__read.c,v 1.1 2020/05/17 22:36:07 rillig Exp $
+
+Fix -Werror=char-subscripts.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
+
+--- libgfortran/io/list_read.c.orig    2020-05-07 10:50:02.000000000 +0000
++++ libgfortran/io/list_read.c
+@@ -2757,7 +2757,7 @@ nml_match_name (st_parameter_dt *dtp, co
+   for (i = 0; i < len; i++)
+     {
+       c = next_char (dtp);
+-      if (c == EOF || (tolower (c) != tolower (name[i])))
++      if (c == EOF || (tolower (c) != tolower ((unsigned char) name[i])))
+       {
+         dtp->u.p.nml_read_error = 1;
+         break;
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/patches/patch-libgfortran_io_read.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc9/patches/patch-libgfortran_io_read.c     Sun May 17 22:36:07 2020 +0000
@@ -0,0 +1,44 @@
+$NetBSD: patch-libgfortran_io_read.c,v 1.1 2020/05/17 22:36:07 rillig Exp $
+
+Fix -Werror=char-subscripts.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
+
+--- libgfortran/io/read.c.orig 2020-05-07 10:50:02.000000000 +0000
++++ libgfortran/io/read.c
+@@ -959,7 +959,7 @@ read_f (st_parameter_dt *dtp, const fnod
+        between "NaN" and the optional perenthesis is not permitted.  */
+       while (w > 0)
+       {
+-        *out = tolower (*p);
++        *out = tolower ((unsigned char) *p);
+         switch (*p)
+           {
+           case ' ':
+@@ -981,7 +981,7 @@ read_f (st_parameter_dt *dtp, const fnod
+               goto bad_float;
+             break;
+           default:
+-            if (!isalnum (*out))
++            if (!isalnum ((unsigned char) *out))
+               goto bad_float;
+           }
+         --w;
+@@ -1109,7 +1109,7 @@ exponent:
+ 
+   if (dtp->u.p.blank_status == BLANK_UNSPECIFIED)
+     {
+-      while (w > 0 && isdigit (*p))
++      while (w > 0 && isdigit ((unsigned char) *p))
+       {
+         exponent *= 10;
+         exponent += *p - '0';
+@@ -1137,7 +1137,7 @@ exponent:
+             else
+               assert (dtp->u.p.blank_status == BLANK_NULL);
+           }
+-        else if (!isdigit (*p))
++        else if (!isdigit ((unsigned char) *p))
+           goto bad_float;
+         else
+           {
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/patches/patch-libgfortran_runtime_environ.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc9/patches/patch-libgfortran_runtime_environ.c     Sun May 17 22:36:07 2020 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-libgfortran_runtime_environ.c,v 1.1 2020/05/17 22:36:07 rillig Exp $
+
+Fix -Werror=char-subscripts.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
+
+--- libgfortran/runtime/environ.c.orig 2020-05-07 10:50:02.000000000 +0000
++++ libgfortran/runtime/environ.c
+@@ -91,7 +91,7 @@ init_integer (variable * v)
+     return;
+ 
+   for (q = p; *q; q++)
+-    if (!isdigit (*q) && (p != q || *q != '-'))
++    if (!isdigit ((unsigned char) *q) && (p != q || *q != '-'))
+       return;
+ 
+   *v->var = atoi (p);
+@@ -344,7 +344,7 @@ static int
+ match_integer (void)
+ {
+   unit_num = 0;
+-  while (isdigit (*p))
++  while (isdigit ((unsigned char) *p))
+     unit_num = unit_num * 10 + (*p++ - '0');
+   return INTEGER;
+ }
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/patches/patch-libquadmath_printf_quadmath-printf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc9/patches/patch-libquadmath_printf_quadmath-printf.c      Sun May 17 22:36:07 2020 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-libquadmath_printf_quadmath-printf.c,v 1.1 2020/05/17 22:36:07 rillig Exp $
+
+Fix -Werror=char-subscripts.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95178
+
+--- libquadmath/printf/quadmath-printf.c.orig  2020-05-07 10:50:02.000000000 +0000
++++ libquadmath/printf/quadmath-printf.c
+@@ -189,7 +189,7 @@ quadmath_snprintf (char *str, size_t siz
+       ++format;
+       info.width = va_arg (ap, int);
+     }
+-  else if (isdigit (*format))
++  else if (isdigit ((unsigned char) *format))
+     /* Constant width specification.  */
+     info.width = read_int (&format);
+ 
+@@ -206,7 +206,7 @@ quadmath_snprintf (char *str, size_t siz
+ 
+         info.prec = va_arg (ap, int);
+       }
+-      else if (isdigit (*format))
++      else if (isdigit ((unsigned char) *format))
+       info.prec = read_int (&format);
+       else
+       /* "%.?" is treated like "%.0?".  */
diff -r 0f5b53f46fea -r f9bde6aeb1a7 lang/gcc9/patches/patch-libquadmath_strtod_strtod__l.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc9/patches/patch-libquadmath_strtod_strtod__l.c    Sun May 17 22:36:07 2020 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-libquadmath_strtod_strtod__l.c,v 1.1 2020/05/17 22:36:07 rillig Exp $
+
+Fix -Werror=char-subscripts.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95178
+
+--- libquadmath/strtod/strtod_l.c.orig 2020-05-07 10:50:02.000000000 +0000
++++ libquadmath/strtod/strtod_l.c
+@@ -57,10 +57,10 @@
+ # define STRING_TYPE char
+ # define CHAR_TYPE char
+ # define L_(Ch) Ch
+-# define ISSPACE(Ch) isspace (Ch)
+-# define ISDIGIT(Ch) isdigit (Ch)
+-# define ISXDIGIT(Ch) isxdigit (Ch)
+-# define TOLOWER(Ch) tolower (Ch)
++# define ISSPACE(Ch) isspace ((unsigned char) Ch)
++# define ISDIGIT(Ch) isdigit ((unsigned char) Ch)
++# define ISXDIGIT(Ch) isxdigit ((unsigned char) Ch)
++# define TOLOWER(Ch) tolower ((unsigned char) Ch)
+ # define TOLOWER_C(Ch) \
+   ({__typeof(Ch) __tlc = (Ch); \
+     (__tlc >= 'A' && __tlc <= 'Z') ? __tlc - 'A' + 'a' : __tlc; })



Home | Main Index | Thread Index | Old Index