commom malloc/free practice breaks standard - author strikes back

Rahul Dhesi dhesi at sun505.UUCP
Wed Oct 18 16:09:28 AEST 1989


>> ...any valid pointer can be converted to a pointer that
>> has less strict alignment and back, so that the result compares equal
>> to the original pointer,
> 
>I can only find this rule for OBJ* -> void* -> OBJ* and OBJ* -> char* -> OBJ*.
>Am I missing a section?

This may the key point.

I, like many others, rely on the gurus in comp.lang.c for much valuable
information.  Can somebody quote chapter and verse to show that the
standard does require the series of casts

     void * ->  OBJ *  ->  void *

to yield the original pointer?

Rahul Dhesi <dhesi%cirrusl at oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi
Do not use From: address for reply if it contains "sun".



More information about the Comp.std.c mailing list