[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CIL (was: Re: [Tinycc-devel] type cast prob.)
From: |
s duclos |
Subject: |
CIL (was: Re: [Tinycc-devel] type cast prob.) |
Date: |
Sun, 10 Nov 2002 10:04:04 -0800 (PST) |
Salut Fabric,
I found CIL that translate C to C.
The resulting C code is a subset of C.
The program "main(){float x; (float)x=(float x);}"
translate to:
$ cat t5cil.c
/* Generated by CIL v. 1.0.4 */
/* print_CIL_Input is true */
# 2 "t5.c"
int main(void)
{ float x ;
{
# 5
x = (float )((int )x);
# 5
return (0);
}
}
$tcc -c t5cil.c
$
CIL is at http://manju.cs.berkeley.edu/cil/
Sylvain.
--- address@hidden wrote:
> Quoting s duclos <address@hidden>:
>
> > Hi,
> >
> > Got this code after expanding up a macro by hand.
> >
> > // t5.c
> > main(){
> > //int x; // OK
> > float x;
> > (int)x = (int)x;
> > }
> >
> > $tcc -c t5.c
> > t5.c:5: lvalue expected
> > $gcc -c t5.c
> > $
> >
> >
> > I know .. it's wierd .. :)
> >
> > Again this is not the real code but some macro
> > that happen to expand to this sort of construct
> > at one point!
> >
> > Another one of those syntactic branch of C I wish
> I
> > didn't knew about .. thanks :)
>
>
> I am not sure that doing (int)x = [...] is correct.
> TCC supports casts only for
> rvalues.
>
> Fabrice.
>
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/tinycc-devel
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2