Subject: Re: c++
To: None <,,>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-toolchain
Date: 07/01/2001 14:17:46
>>> 	../include/LiDIA/kernel/udigit_interface.h:75: warning: ANSI C++ forbids cast to non-reference type used as lvalue
>> Wow. g++ is totally confused. There's no kind of (C or C++) lvalue
>> on that line.  It really oughtn't even be doing checks for casting
>> and such in asm code.

>>> 	__asm__ ("addl %5,%1\n\tadcl %3,%0" :
>>> 	"=r" ((USItype)( new_carry )), "=&r" ((USItype)( sum )) :

There are two lvalues there: new_carry and sum.  Note that they are
*output* operands from the asm.  As extend.texi says, "Output operand
expressions must be lvalues".  (The = operand constraint character is
not an assignment operator, though likely it was chosen for its
similarity to one.  But output operands to extended asm statements
function like assignment LHSes even though there is no explicit
assignment operator present.)

And sure enough, they're being cast.

I think the compiler is exactly right.  What am I missing?

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B