Suspicious pointer conversion warning in Turbo C 2.0

Karl Heuer karl at haddock.ima.isc.com
Fri Jul 27 10:35:29 AEST 1990


>> void AddLNode(void ** Hptr, void * Nptr);
>> Tlist *Head, *Walker;
>> AddLNode(&Head,Walker);	/* This statement generates a warning */
>
>The warnings you are getting are from the first parameter.  When I cast
>it to AddLNode((void **)&Head, Walker); I don't get any warnings.

It should be noted that, although you can silence the warnings, the code
is incorrect with or without the cast.  It works on vaxlike architectures,
but will probably fail on (existing, not hypothetical) implementations where
`Tlist *' and `void *' do not have the same internal format.

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint
Followups to comp.lang.c only.



More information about the Comp.lang.c mailing list