[Info-vax] nice for VMS

Arne Vajhøj arne at vajhoej.dk
Sun Apr 19 21:05:49 EDT 2009


Bob Koehler wrote:
> In article <49e7cd7e$0$90272$14726298 at news.sunsite.dk>, =?ISO-8859-1?Q?Arne_Vajh=F8j?= <arne at vajhoej.dk> writes:
>> If we speak about C then I believe that type of pointer fun is
>> either undefined or implementation specific behavior, so there
>> would most certainly not be any point in complaining.
> 
>    I don't have a copy of the standard handy, but I beleive in C that
>    behaviour is defined.  I would not be surprised to see a vendor
>    break it and would seriously avoid code depending on it.

Some relevant clauses are:

"A pointer to an object or incomplete type may be converted to a pointer 
to a different
object or incomplete type. If the resulting pointer is not correctly 
aligned48) for the
pointed-to type, the behavior is undefined."

"K.2 Undefined behavior
...
Conversion between two pointer types produces a result that is 
incorrectly aligned"

I think SUN's C compiler is within ISO/ANSI.

Arne



More information about the Info-vax mailing list