Re: More fun with aliasing - removing assignments?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Diego Novillo <dnovillo@xxxxxxxxxx> writes:

> Does the language allow the creation of address locations out of
> arbitrary integer values?

Yes.

    6.3.2.3 Pointers

    5 An integer may be converted to any pointer type. [...]

>  Is the dereference of such an address a defined operation?

It is implemetation-defined.

    [...] Except as previously specified, the result is
    implementation-defined, might not be correctly aligned, might not
    point to an entity of the referenced type, and might be a trap
    representation.

Also, the integer may have been the result of casting a valid pointer, in
which case the operation is fully defined (assuming the integer is wide
enough).

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux