This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C constant expressions proposals
On Sat, 14 Aug 2004, Gabriel Dos Reis wrote:
> I think the treatment of __complex__ is not right. They are morally
> arrays of two data. I was expecting them to be treated as in the array
> case, i.e. __real__ and __imag__ yield a constant expression when the
> operand is a constant expression.
They do, for integer and arithmetic constant expressions. They don't as
presently written for address constants but somehow I think anyone
converting addresses to complex integer types - a GNU extension - gets
what they deserve.
But I see I didn't specify what happens for complex constants (a GNU
extension), both integer and floating point, so I'll do that (i.e. they
act as integer or floating point constants as appropriate), and explicitly
say that integer complex arithmetic uses the usual formulas and overflows
if they do (see bug 2995). I'll also make it so that you can't have
address constants of complex integer type, which seems to be existing
practice.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)