Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!rochester!cornell!uw-beaver!tektronix!percival!parsely!agora!rickc From: rickc@agora.UUCP (Rick Coates) Newsgroups: comp.std.c Subject: Re: function returning pointer to itself Message-ID: <1067@agora.UUCP> Date: 24 Jul 88 14:03:19 GMT References: <1065@agora.UUCP> <672@goofy.megatest.UUCP> Organization: Advanced Solutions, Hillsboro, OR Lines: 72 In article <672@goofy.megatest.UUCP>, djones@megatest.UUCP (Dave Jones) writes: (deleted) > (Some wierd architectures use different formats for data pointers > and function pointers, which again proves that most hardware ^ This occurred to me, then I thought, nooooo, no one would do that. > designers should be in jail. I'm sure _you_ never did anything like > that when you were in the hardware game, right?) Heavens, no! I had a group of software (well, firmware) folks to keep me on track! (deleted) > be done. You can, however, return a structure which contains a > field pointing to the function, as a couple of correspondants have > demonstrated. > Cute. (I haven't seen these responses) > > Microsoft C 5.1 for IBM pc's > (deleted) > > > I think your compiler is broke. It is my understanding that it No surprises here! > should warn you that the "return test_func" line does not return a void*. > Here's what the Sun3 compiler says: Now - my question: (disclaimer first: I am not trying to start a 'compiler wars' here - compilers are not standards. They are, however, - in theory - based on standards, and, more importantly, they are the only way to _test_ (as opposed to talking about and interpreting) standards. They are also what we have to work with every day.) As far as I know, Sun does not claim to support the dpANSI standard, and in fact has not even made any official committment to supporting it ever. Has AT&T said when, if ever, they will support ANSI C? Any other Unix supplier? Anyone besides the PC world? Yes, I know that Sun supports many features of dpANSI, but not all (like function prototyping). > > P.S. > > I didn't really mean it about the hardware designers belonging in > jail. I think that a comprehensive work-furlow program with adequate > counciling and group programming support sessions should be the norm > in a modern society. > > > D.J. My candidate for Hardware Out Of Control is the IBM EGA/VGA 'standard'. I can understand ugly choices to keep costs low, but the EGA has lots of silicon implementing useless functions! But no support for drawing lines! Argh. Just so that Things don't get too out of hand, here: I have plenty of stories about Software Out Of Control, too. Rick Coates Consulting Engineer tektronix!reed!percival!agora!rickc OR tektronix!sequent!islabs!ateq!rick