This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Pathalogical divides
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Subject: Re: Pathalogical divides
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Mon, 25 Sep 2000 14:26:49 -0700
- CC: gcc at gcc dot gnu dot org
- References: <10009250957.AA08688@vlsi1.ultra.nyu.edu>
> Date: Mon, 25 Sep 00 05:57:11 EDT
> From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
> Cc: gcc@gcc.gnu.org
>
> It says, in s. 6.5 paragraph 5 of ISO/IEC 9899:1999:
>
> If an _exceptional condition_ occurs during the evaluation of an
> expression (that is, if the result is not mathematically defined or
> not in the range of representable values for its type), the behaviour
> is undefined.
>
> 'undefined behaviour' can always include a signal, or anything else
> that a mad compiler designer could dream up.
>
> Sure, except that the (largest_negtive_number % -1) *is* mathematically
> defined: anything mod -1 is 0! It's the corresponding *division* that's
> undefined, but that isn't what the programmer is requesting.
I see! You are right. Yes, this is required to work.
--
- Geoffrey Keating <geoffk@cygnus.com>