This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: iconv/loop.c vs gcc-3.1: divide by zero in #if


Roland McGrath <roland@frob.com> 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 <drepper@cygnus.com>, 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]