This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C constant expressions proposals


On Sat, 14 Aug 2004, Gabriel Dos Reis wrote:

> The bit I'm not happy with is:
> 
>     E.float_constant := false
> 
> it should be  
> 
>     E.float_constant := E1.float_constant

No, float_constant says whether something is literally a floating point 
constant (possibly inside parentheses), not some more complicated 
expression involving them.  This is tracked because integer constant 
expressions allow floating point constants that are immediate operands of 
casts, but don't otherwise allow floating point constants - in particular, 
(int)(__imag__ 2.0i) isn't an integer constant expression.

>    E.bad_operator := false
>    E.overflow := E1.overflow

bad_operator and overflow are inherited from E1 by virtue of

E.attrs := E1.attrs

If there is a prohibited operator (assignment, increment, decrement, 
function call or comma) in E1 outside of sizeof (C90) / an evaluated part 
of E1 (C99), then there still is in __real__ E1 and __imag__ E1.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]