Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!mtxinu!rtech!ingres!ingres.com!mikes From: mikes@ingres.com (Mike Schilling) Newsgroups: comp.lang.c Subject: Are all structure pointers grey in the dark? Message-ID: <1991May29.161602.26744@ingres.Ingres.COM> Date: 29 May 91 16:16:02 GMT References: <1991May28.115914.19879@email.tuwien.ac.at> Distribution: comp Lines: 25 From article <1991May28.115914.19879@email.tuwien.ac.at>, by hp@vmars.tuwien.ac.at (Peter Holzer): > > #pragma speculation_mode on /* :-) */ > There is a rumor among C-programmers that `all struct-pointers smell > the same.' (I could not find any assertion of this in the standard, and > I can find pro's and con's for such a rule, so I call it a rumor, > undoubtedly someone who knows will tell me if it is correct or not) Consider the following legal and complete C module: sub() { struct s { struct t *p; }s1; s1.p = (struct t *)&s1; } The compiler has to generate a 'struct t' pointer, with no idea of 'struct t's defintion. ---------------------------------------------------------------------------- mikes@rtech.com = Mike Schilling, ASK Corporation, Alameda, CA Just machines that make big decisions, Programmed by fellows with compassion and vision. -- Donald Fagen, "IGY"