Suspicious pointer conversion warning in Turbo C 2.0

Steve Resnick stever at Octopus.COM
Thu Jul 26 09:08:36 AEST 1990


Hello Netlanders!

	Here's one for you...
 As far as I know, when I provide a prototype for a function which accepts
 a void pointer, the compiler should not bitch about type conversions between
 pointers. The code fragment below generates a warning message when I pass a
 pointer to a structure. The parameter bitched about is the second pointer.
 The first pointer in both cases is not complained about. The compiler
 generates the correct code, but I am wondering whether it should be
 bitching at me in the first place. Any ideas?

 Cheers!
 Steve


void AddLNode(void ** Hptr, void * Nptr);
void * DelLNode(void ** , void * );
main()
{
	Tlist *Head, *Walker;
	.
	.
	.
	AddLNode(&Head,Walker);	/* This statement generates a warning */
	for (Walker = Head; Walker != NULL ; Walker = Walker->Next)
		if (Walker->Idx == 0xDEAD)
			DelLNode(&Head,Walker); /* This statement generates a
						 warning */
}



-- 
----------------------------------------------------------------------------
{apple|pyramid|sun}!octopus!stever} Disclaimer: I speak only for me! 8-)
Flames, grammar errors, spelling errrors >/dev/nul
----------------------------------------------------------------------------



More information about the Comp.lang.c mailing list