From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22328 invoked by alias); 19 May 2002 17:03:58 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 22290 invoked from network); 19 May 2002 17:03:54 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 19 May 2002 17:03:54 -0000 Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id 33A991EA97; Sun, 19 May 2002 19:03:54 +0200 (MEST) Received: from aj by arthur.inka.de with local (Exim 3.34 #1) id 179U4r-0002zG-00; Sun, 19 May 2002 19:02:37 +0200 Mail-Copies-To: never To: Roland McGrath Cc: GNU libc hackers Subject: Re: iconv/loop.c vs gcc-3.1: divide by zero in #if References: <20020516200512.1633B1BA17@perdition.linnaean.org> From: Andreas Jaeger Date: Sun, 19 May 2002 10:03:00 -0000 In-Reply-To: <20020516200512.1633B1BA17@perdition.linnaean.org> (Roland McGrath's message of "Thu, 16 May 2002 16:05:12 -0400 (EDT)") Message-ID: User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-05/txt/msg00025.txt.bz2 Roland McGrath writes: > Using gcc-3.1 I get "divide by zero in #if" for several iconv modules > without the following change. Ok to put this in (with log entry, of course)? This just bits me also. Roland's patch (with the obvious fix) solved the problem. I'd like to see this committed soon. > > Index: loop.c > =================================================================== > RCS file: /cvs/glibc/libc/iconv/loop.c,v > retrieving revision 1.28 > diff -u -p -r1.28 loop.c > --- loop.c 15 Jul 2001 15:18:22 -0000 1.28 > +++ loop.c 16 May 2002 06:24:49 -0000 > @@ -1,5 +1,5 @@ > /* Conversion loop frame work. > - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. > + Copyright (C) 1998,99,2000,01,02 Free Software Foundation, Inc. > This file is part of the GNU C Library. > Contributed by Ulrich Drepper , 1998. > > @@ -296,17 +296,19 @@ FCTNAME (LOOPFCT) (struct __gconv_step * > /* Include the file a second time to define the function to handle > unaligned access. */ > #if !defined DEFINE_UNALIGNED && !defined _STRING_ARCH_unaligned \ > - && MIN_NEEDED_FROM != 1 && MAX_NEEDED_FROM % MIN_NEEDED_FROM == 0 \ > - && MIN_NEEDED_TO != 1 && MAX_NEEDED_TO % MIN_NEEDED_TO == 0 > -# undef get16 > -# undef get32 > -# undef put16 > -# undef put32 > -# undef unaligned > - > -# define DEFINE_UNALIGNED > -# include "loop.c" > -# undef DEFINE_UNALIGNED > + && MIN_NEEDED_FROM > 1 && MIN_NEEDED_TO > 1 > +# if MAX_NEEDED_FROM % MIN_NEEDED_FROM == 0 \ > +# && MAX_NEEDED_TO % MIN_NEEDED_TO == 0 Remove the hash here, Andreas > +# undef get16 > +# undef get32 > +# undef put16 > +# undef put32 > +# undef unaligned > + > +# define DEFINE_UNALIGNED > +# include "loop.c" > +# undef DEFINE_UNALIGNED > +# endif > #endif > > > -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj