🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #144

Question about ANSI-C

#144
From: vulture
Date: Mon, 10 Aug 1992 20:49
30 lines
1269 bytes
Ok, I've got a question for the folks here regarding ANSI-C.

According to my current book which may be outdated (if so, please offer
better books to use) it says that the prototype 'void *' was introduced
to ANSI C "to represent a 'universal' data pointer."

By implication, would a 'universal' data pointer complain about a
mismatch of pointer types?

(example:)
	My code says:
		typedef struct prot1 {
			int (*mycall)(char *parm1, void *parm_ptr );
			} PRO1;

		static int myfunc1 ( char *myparm1, PRO2 *ptr1 )
			{ /* PRO2 not the same as PRO1 */
			}

		static PRO1 stuff[] = {
			myfunc1,  /* warning: initialization type mismatch */
			NULL
			};

Thanks in advance for the time.
-- 
<< MCT >>  Michael C Tiernan. - GEnie:M.Tiernan - AOL:M Tiernan/BCS Mike 
UUCP = alfalfa!pro-angmar!m.tiernan OR miket@frog.UUCP
      It's too bad that it takes almost half of our life
	to realize that it was a "Do-It-Yourself" project.
Technical Details
Message-ID: <1992Aug10.204928.14917@frog.CRDS.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!caen!nic.umass.edu!m2c!crackers!frog!miket

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!caen!nic.umass.edu!m2c!crackers!frog!miket
From: miket@frog.CRDS.COM (vulture)
Newsgroups: comp.std.c
Subject: Question about ANSI-C
Message-ID: <1992Aug10.204928.14917@frog.CRDS.COM>
Date: 10 Aug 92 20:49:28 GMT
Organization: Charles River Data Systems
Lines: 30