From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4094 invoked by alias); 16 May 2002 20:05:15 -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 4051 invoked from network); 16 May 2002 20:05:12 -0000 Received: from unknown (HELO perdition.linnaean.org) (66.30.9.234) by sources.redhat.com with SMTP; 16 May 2002 20:05:12 -0000 Received: by perdition.linnaean.org (Postfix, from userid 5281) id 1633B1BA17; Thu, 16 May 2002 16:05:12 -0400 (EDT) From: Roland McGrath MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: GNU libc hackers Subject: iconv/loop.c vs gcc-3.1: divide by zero in #if Emacs: anything free is worth what you paid for it. Message-Id: <20020516200512.1633B1BA17@perdition.linnaean.org> Date: Thu, 16 May 2002 13:05:00 -0000 X-SW-Source: 2002-05/txt/msg00023.txt.bz2 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)? 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 +# undef get16 +# undef get32 +# undef put16 +# undef put32 +# undef unaligned + +# define DEFINE_UNALIGNED +# include "loop.c" +# undef DEFINE_UNALIGNED +# endif #endif