X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com Message-ID: <590BA4E2.4000406@gmx.de> Date: Fri, 05 May 2017 00:02:10 +0200 From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp-workers AT delorie DOT com]" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7 MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: gcc-7.1.0 References: <6953e282-24aa-2b4e-2141-385d8b443111 AT iki DOT fi> <590A6154 DOT 8010308 AT gmx DOT de> <83a86shf9d DOT fsf AT gnu DOT org> In-Reply-To: <83a86shf9d.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:LNlsOf8DUytf8P5uZ0S5jhn4OBFJyaudz5Dksn3fSw/oncSNURg tJkTemOUBjmU95Y0erPZ36+1RYD+37eAPKWA4NmSxf3h6f5R/GGEJpEU8zugyPIXeCHqWEy lEOg13BBtHbycbp91GPwAX0+M4Ducab748FMnA2kSRdeXiDNZEuXCTyORnTzUUn89fIwFiC hqbQ70ghVUIPvcSIhlbRQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:cg23e6Nk8iA=:Zyjudxj+6asEbEekB8/03E yqnLSXgl8qW8pcxrId++aw3/cMmJHBcbPPOmJb7XkfJDotxhPo/Lqj1YEnrscycioXWy2PnlF fc2SR1zDqxTb8uDQ7OOQ4hqh6eHViqn63Btomj2gpl3OzoJFSMrJgVP3/uhg5dXiEludWTuM1 b74Tn7+nE5TwELClHfTodG/wv9HgK6EF7ci+trgJOpk8rgzK3y4D9uixBKOnbG8tsXSlC6e0x un53e6ZeoNHQrtCoa5Nqr4e1RAdVowLIeg48zz2bgw3KG70m94E1ccGu3osEC7qqLdQSwoezE tOga7LJSPMT0nvEsuABRssYml96MiIXJefWx1zpS+bljFcP6vHJbuGzJsGt1hYecQGH9KFSWR C5VswOLLkdsI4ZnFfbzjakNQTdhrvMgzOHG+Ritbe1FZLoWbRmp7VA7+YSD6IjrpKNla7CB5+ EQ20SA/hSY+pO4wRAeH8upIGA3rHV0zhpA5d2ux4ay+nGm+PUIYaGW26pujlQSh4qLQy7fw9L ed1f1+uMPCI85mseh6gx0eCNBiyP0UrUhKgaOa+lYpQeXmqVcobS2IpEmafGRrHYC5VS2NhIZ nOyPJWlZEd1MKMbxt2hvEexflA9vOtQTPZoEQZCudwyNNzT7k7M3fwSQquAOIOZNHHiL/3v5H zuESDbFmPfZWJ4kMk6s2eXsf42YbAIJqIYveo2wNPhdWspIgez0TsNrroWTz6UpWdOya1wfix C763byZuqUMO1OSnduY0wmP+elhaZ6G7/AQzKM8LssBQP0tVpKlA8QTIY0esVsycuuceik1da Rv2F0jh Reply-To: djgpp-workers AT delorie DOT com Am 04.05.2017 16:23, schrieb Eli Zaretskii (eliz AT gnu DOT org) [via djgpp-workers AT delorie DOT com]: >> Date: Thu, 04 May 2017 01:01:40 +0200 >> From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp-workers AT delorie DOT com]" [snip] > > It's probably best to tweak the code to make sure the buffer overruns > cannot happen. I have tried to fix the buffer overruns by recomputing the length correctly so the compiler stops complaining. Also some minor warnings in the zoneinfo code has been fixed but they do not stop compilation. I have added "break" in switch statements where they are missed. Neitherless there are some warnings due to intentional fall throughs that may be suppressed by excluding the corresponding compiler warning settings [-Wimplicit-fallthrough=]. As usual suggestions, objections, comments are welcome. Regards, Juan M. Guerrero 2017-05-04 Juan Manuel Guerrero * djgpp/src/libc/dos/process/dosexec.c: Buffer overruns fixed. * djgpp/zoneinfo/src/date.c: Pacifiy compiler [-Wimplicit-fallthrough=]. * djgpp/zoneinfo/src/makefile: Warnings about intentional fall througs suppressed. diff -aprNU5 djgpp.orig/src/libc/dos/process/dosexec.c djgpp/src/libc/dos/process/dosexec.c --- djgpp.orig/src/libc/dos/process/dosexec.c 2015-05-02 07:32:18 +0000 +++ djgpp/src/libc/dos/process/dosexec.c 2017-05-04 22:02:44 +0000 @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2015 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2012 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2011 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */ @@ -403,11 +404,11 @@ direct_exec_tail_1 (const char *program, parm_la += tbuf_beg; program_la += tbuf_beg; if ((initial_tbuf_selector != tbuf_selector) && proxy_off) { - char temp[65], *s, t2[5]; + char temp[65], *s, t2[9]; sprintf (t2, "%04lX", tbuf_beg>>4); dosmemget (tbuf_beg+proxy_off, 64, temp); temp[64] = 0; s = strchr(temp,'\r'); if (s) *s = 0; @@ -1102,11 +1103,11 @@ static int go32_exec(const char *program _farpokew(_dos_ds, tbuf_beg + argv_off, 0); argv_off += sizeof(short); argv[0] = save_argv0; - proxy_cmdline = (char *)alloca (34); + proxy_cmdline = (char *)alloca (__PROXY_LEN + 5 * (1 + 4) + 1); sprintf(proxy_cmdline, "%s=%04x %04x %04x %04x %04x", __PROXY, argc, (unsigned)(tbuf_beg >> 4), rm_off & 0xffff, (unsigned)(tbuf_beg >> 4), si_off & 0xffff); diff -aprNU5 djgpp.orig/zoneinfo/src/date.c djgpp/zoneinfo/src/date.c --- djgpp.orig/zoneinfo/src/date.c 2013-09-06 17:25:44 +0000 +++ djgpp/zoneinfo/src/date.c 2017-05-04 22:14:24 +0000 @@ -126,10 +126,11 @@ main(const int argc, char *argv[]) format = value = NULL; while ((ch = getopt(argc, argv, "ucnd:t:a:")) != EOF && ch != -1) { switch (ch) { default: usage(); + break; case 'u': /* do it in UTC */ case 'c': dogmt(); break; case 'n': /* don't set network */ @@ -658,10 +659,11 @@ convert(register const char * const valu cp = value; switch (dotp - cp) { default: wildinput(_("time"), value, _("main part is wrong length")); + break; case 12: if (!dousg) { cent = ATOI2(cp); year_in_cent = ATOI2(cp); } diff -aprNU5 djgpp.orig/zoneinfo/src/makefile djgpp/zoneinfo/src/makefile --- djgpp.orig/zoneinfo/src/makefile 2015-05-24 07:50:02 +0000 +++ djgpp/zoneinfo/src/makefile 2017-05-04 23:45:26 +0000 @@ -194,10 +194,14 @@ ifeq ($(filter 2,$(CROSS_GCC_MAJOR)),) CROSS_GCC3_DFLAGS = -Wbad-function-cast -Wno-sign-compare -Wno-unused-parameter ifeq ($(filter 3,$(CROSS_GCC_MAJOR)),) ifeq ($(filter 4,$(CROSS_GCC_MAJOR)),) # gcc >= 5.x CROSS_GCC4_DFLAGS = -Wno-type-limits +ifeq ($(filter 6,$(CROSS_GCC_MAJOR)),) +# gcc >= 7.x +CROSS_GCC4_DFLAGS = -Wno-implicit-fallthrough +endif else # gcc >= 4.x ifeq ($(filter 0 1 2,$(CROSS_GCC_MINOR)),) # gcc >= 4.3 CROSS_GCC4_DFLAGS = -Wno-type-limits @@ -213,10 +217,14 @@ ifeq ($(filter 2,$(GCC_MAJOR)),) GCC3_DEBUG_FLAGS = -Wbad-function-cast -Wno-sign-compare -Wno-unused-parameter ifeq ($(filter 3,$(GCC_MAJOR)),) ifeq ($(filter 4,$(GCC_MAJOR)),) # gcc >= 5.x GCC4_DEBUG_FLAGS = -Wno-type-limits +ifeq ($(filter 6,$(GCC_MAJOR)),) +# gcc >= 7.x +GCC4_DFLAGS = -Wno-implicit-fallthrough +endif else # gcc >= 4.x ifeq ($(filter 0 1 2,$(GCC_MINOR)),) # gcc >= 4.3 GCC4_DEBUG_FLAGS = -Wno-type-limits