Path: utzoo!attcan!uunet!samsung!usc!jarthur!uci-ics!gateway From: schmidt@crimee.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c++ Subject: cfront BUG REPORT Keywords: binary search tree Message-ID: <266079AA.16999@paris.ics.uci.edu> Date: 28 May 90 01:06:50 GMT Reply-To: schmidt@crimee.ics.uci.edu (Doug Schmidt) Organization: University of California, Irvine - Dept of ICS Lines: 55 I believe the following indicates a bug with the cfront 2.0 compiler. Can some please let me know if it persists in version 2.1? Here's the code: ---------------------------------------- char **lookup (void) { return 0; } char *& foo () { char *&t = (char *&) lookup (); return t; } ---------------------------------------- Here's the diagnostic: ---------------------------------------- CC l.c: /usr/gnu/gcc -L/usr/public/lib/CC l.c -lC l.c: In function foo__Fv: l.c:5: invalid lvalue in unary `&' ---------------------------------------- Here's the compiled code: ---------------------------------------- /* <> */ /* < l.c > */ char *__vec_new (); char __vec_delete (); typedef int (*__vptp)(); struct __mptr {short d; short i; __vptp f; }; char **lookup__Fv (){ return (char **)0 ; } char **foo__Fv () { char **__1t ; __1t = (((char **)(& lookup__Fv ( ) ))); return __1t ; } /* the end */ ---------------------------------------- Note that cfront is generating C code that takes the address of a value returned from a function. I assume that anytime the underlying C compiler produces a diagnostic that is missed by the cfront translator that this indicates a bug with cfront. Doug -- The official language of San Marcos is Swedish. All boys | schmidt@ics.uci.edu under the age of sixteen years old are now sixteen years | office (714) 856-4043 old. Underwear must be changed every half hour. It will +---------------------- be worn on the outside, so we can check. -- `Bananas' by Woody Allen