Path: utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!rutgers!ucsd!orion.cf.uci.edu!paris.ics.uci.edu!crimee.ics.uci.edu!schmidt From: schmidt@crimee.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.gcc.bug Subject: Legal ansi? Message-ID: <765@paris.ics.uci.edu> Date: 5 Oct 88 01:06:20 GMT Sender: news@paris.ics.uci.edu Reply-To: Doug Schmidt Distribution: gnu Organization: University of California, Irvine - Dept of ICS Lines: 27 References: Hi, Is the following short code legal Ansi-C? gcc -ansi accepts it, gcc -pedantic rejects it, and the Sun 4.0 cc compiler also rejects it. thanks, Doug ---------------------------------------- typedef int ITEM_TYPE; typedef struct Tree Tree; struct Tree { ITEM_TYPE Item; char Tag; Tree *Left; Tree *Right; } *Root; int Test ( P, Item ) Tree *P; ITEM_TYPE Item; { (( P->Item > Item ) ? P->Left : P->Right ) = (Tree *) malloc(sizeof(Tree)); } ----------------------------------------