Hi,
I'm using gcc version 3.4.5 (mingw special) with version 3.15.1 of the
mingw runtime package - on Windows XP and Windows Vista.
The following is as I expect:
######################
C:\_32\c>type bug.c
#include <stdio.h>
#include <stdlib.h>
int main(void) {
double a = 0x123.1P-02;
printf("%f\n", a);
return 0;
}
C:\_32\c>gcc -o bug.exe bug.c
C:\_32\c>bug
72.765625
C:\_32\c>
######################
But if I try to compile the same source using the -ansi switch, the program
fails to build:
######################
C:\_32\c>gcc -ansi -o bug.exe bug.c
bug.c:5:16: exponent has no digits
C:\_32\c>
######################
I'm not exactly sure how MinGW is supposed to react to doubles being
assigned a hex value, but the differing behaviour looks buggy to me.
(Apologies if I'm wrong about that.)
Cheers,
Rob
Nobody/Anonymous
gcc
None
Public
|
Date: 2008-12-31 03:24 -ansi switch enforces only C89 standard. hex float was introduced with |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2008-12-31 03:24 | dannysmith |
| resolution_id | None | 2008-12-31 03:24 | dannysmith |
| category_id | mingw runtime | 2008-12-31 03:24 | dannysmith |
| close_date | - | 2008-12-31 03:24 | dannysmith |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use