[LLVMbugs] [Bug 2963] "enumerator value is not an integer constant" error when using macros

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Oct 28 06:41:30 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2963


Neil Booth <neil at daikokuya.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |neil at daikokuya.co.uk
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




--- Comment #4 from Neil Booth <neil at daikokuya.co.uk>  2008-10-28 08:41:29 ---
My front end gives

"/tmp/bug.c", line 14: error: a floating constant in an integer constant
        expression must be cast to integer type
        SOME_VALUE= FLOAT_TO_SHORT_FIXED(0.1)
                    ^

1 error found compiling "/tmp/bug.c".

which is perhaps slightly more helpful.  There isn't a good way around this -
the standard is reluctant to impose any hard requirements on compile-time
calculation of target floating point arithmetic, viewing it as too much of a
burden in general on implementations, although for IEEE targets it's not too
hard to do perfectly with about 1000 lines of code (and clang has this code). 
But that is the reason for this constraint :(

Perhaps clang should accept with a warning, unless pedantic?

Reopening as it seems others agree.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list