[Bug c/56397] New: Floating Point constant in C, with standard C99
argentinator.gcc.questions at outlook dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 19 14:37:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56397
Bug #: 56397
Summary: Floating Point constant in C, with standard C99
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: argentinator.gcc.questions@outlook.com
Created attachment 29496
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29496
Source code, ".i" file, and compiler output in a ".txt" file.
I think that the compiler doesn't recognize properly the type of the
floating-point constants for the standard C99.
A straight example is the simple sentence:
(1.1F & 1);
In this case, 1.1F should be considered as a 'float' constant,
but the compiler triggers this error message:
error: invalid operands to binary & (have 'long double' and 'int')
Thus, the compiler considers that 1.1F has type 'long double', but 'float' is
expected.
I am running GCC 4.6.1 with MinGW, under a Windows 7 system.
In my system, FLT_EVAL_METHOD == 2, but I think that this is not the problem,
and that we have actually some kind of compiler bug.
The source code is just this:
---------------------------------------------------
int main(void) {
1.1F & 1;
}
More information about the Gcc-bugs
mailing list