[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#650275: marked as done (gcc-4.6: Does only detect division by zero for int, not float)



Your message dated Thu, 5 Jan 2012 18:18:55 -0600
with message-id <20120106001855.GA21380@elie.hsd1.il.comcast.net>
and subject line Re: gcc-4.6: Does only detect division by zero for int, not float
has caused the Debian Bug report #650275,
regarding gcc-4.6: Does only detect division by zero for int, not float
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
650275: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650275
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-4.6
Version: 4.6.2-5
Severity: minor

Hi,

I find it strange and inconsistent that gcc only detects and reports hard-coded
devision by zero for int variables but not for those of type float. If you
compile the attached example, gcc will print the following warning:

$ gcc -W -Wall -Wextra nan.c
nan.c: In function ‘main’:
nan.c:6:18: warning: division by zero [-Wdiv-by-zero]

Please note that this warning is true for both lines 5 and 6.

Best Regards,
Fabian



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (501, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-2-686-pae (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-4.6 depends on:
ii  binutils      2.22-1        
ii  cpp-4.6       4.6.2-5       
ii  gcc-4.6-base  4.6.2-5       
ii  libc6         2.13-21       
ii  libgcc1       1:4.6.2-5     
ii  libgmp10      2:5.0.2+dfsg-2
ii  libgomp1      4.6.2-5       
ii  libmpc2       0.9-4         
ii  libmpfr4      3.1.0-3       
ii  libquadmath0  4.6.2-5       
ii  zlib1g        1:1.2.5.dfsg-1

Versions of packages gcc-4.6 recommends:
ii  libc6-dev  2.13-21

Versions of packages gcc-4.6 suggests:
pn  binutils-gold        <none>
pn  gcc-4.6-doc          <none>
pn  gcc-4.6-locales      <none>
pn  gcc-4.6-multilib     <none>
pn  libgcc1-dbg          <none>
pn  libgomp1-dbg         <none>
pn  libmudflap0-4.6-dev  <none>
pn  libmudflap0-dbg      <none>
pn  libquadmath0-dbg     <none>

-- no debconf information
#include <stdio.h>

int main (void)
{
        float f = 0/0.;
        int i = 0/0;

        printf("f: %f, i: %d\n", f, i);

        return 0;
}

--- End Message ---
--- Begin Message ---
notfound 650275 gcc-4.6/4.6.2-5
quit

Hi Fabian,

Fabian Greffrath wrote:

> I find it strange and inconsistent that gcc only detects and reports hard-coded
> devision by zero for int variables but not for those of type float.
[...]
>         float f = 0/0.;

This is by design.  0/0. is a perfectly valid floating-point
number[1].

Thanks for writing,
Jonathan

[1] http://grouper.ieee.org/groups/754/faq.html#exceptions


--- End Message ---

Reply to: