delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/12/07/02:26:25

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
Message-ID: <50C19A0A.50701@gmail.com>
Date: Fri, 07 Dec 2012 08:26:02 +0100
From: marco atzeri <marco DOT atzeri AT gmail DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: gcc -ansi produces unexpected floating point result
References: <DFF9A312BD064EE8916D4AFB1288E369 AT PPPHP>
In-Reply-To: <DFF9A312BD064EE8916D4AFB1288E369@PPPHP>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 12/7/2012 8:04 AM, Paul Edwards wrote:
> /* This program demonstrates a presumed bug in gcc 3.4.4 shipped
>    with cygwin.

try gcc4, gcc3 is obsolete.

If still exist, please check if the bug is present also
on another platforms as it could be a general issue and not
a cygwin specific one.


>
>    If compiled with gcc -mno-cygwin -ansi, it prints:
>
> C:\devel\bwbasic>gcc -mno-cygwin -ansi zatest.c
>
> C:\devel\bwbasic>a
> 0.000000
> 2.000000
>
>    Instead of the expected 2.000000 for the first line, and undefined
>    for the second line.
>
>    Without -ansi it produces a good result.
>
> */
>
> #include <stdio.h>
>
> int main(void)
> {
>     double x = 2.0;
>
>     printf("%lf\n", x);
>     printf("%f\n", x);
>     return (0);
> }
>
>
Regards
Marco



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019