🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1749

Legal ansi?

#1749
From: Doug Schmidt
Date: Wed, 05 Oct 1988 01:06
28 lines
1031 bytes
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));
}
----------------------------------------
Technical Details
Message-ID: <765@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!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

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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 <schmidt@crimee.ics.uci.edu>
Distribution: gnu
Organization: University of California, Irvine - Dept of ICS
Lines: 27