Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Apr 2005 11:43:30 -0700
From:      Bakul Shah <bakul@BitBlocks.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-current@freebsd.org
Subject:   Re: smbfs bug introduced at smbfs_vnops.c:1.58 
Message-ID:  <200504101843.j3AIhUh0046427@gate.bitblocks.com>
In-Reply-To: Your message of "Mon, 11 Apr 2005 03:55:31 %2B1000." <20050411032601.S55302@delplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> A similar example with "double a;" is more interesting.  This also
> gives undefined behaviour (C99 6.5.5[#5]).  However, this is bogus if
> there is a floating point infinity.  C99 has support for IEEE floating
> point and it is clearly intended that the behaviour of 1.0/0.0 is to
> give +Inf and raise the divide-by-zero exception, but I couldn't see
> anywhere in the C99 draft n869.txt where this is spelled out (raising of
> the divide-by-zero exception is spelled out for lots of math functions
> but doesn't seem to be mentioned for plain division).

This is indirectly spelled out in draft n2764.txt in annex F:

       F.3  Operators and functions

       [#1] C operators and functions provide  IEC  60559  required
       and recommended facilities as listed below.

         -- The +, -, *, and / operators provide the IEC 60559 add,
            subtract, multiply, and divide operations.

IEC 60599 (aka IEEE754) clearly states the behavior for
divide by zero.  6.5.5 does say x/0 is undefined but if
__STDC_IEC_559__ is defined then IEEE behavior is expected.

I haven't checked gassy-c (gcc) for conformance.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504101843.j3AIhUh0046427>