[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Contribution to the Hurd on L4
From: |
Ludovic Courtès |
Subject: |
Re: Contribution to the Hurd on L4 |
Date: |
Fri, 7 Jan 2005 10:17:07 +0100 |
User-agent: |
Mutt/1.5.3i |
Hi,
On Thu, Jan 06, 2005 at 10:46:04PM +0100, Marcus Brinkmann wrote:
> Ok, the actual rules are complicated, but the basic rule is that two
> pointers to different types never ever point to overlapping memory
> regions. This means that you can't cast pointers to other types and
> expect them to work. The compiler can just optimize away derefences
> to pointers which have the value of a different type. An exception is
> char*, which can always be used (otherwise memcpy and friends would
> not do what you expect).
My understanding of the standard [1] (section 6.7.3.1) is that what you
describes holds _only_ for `restrict'-qualified pointers, not for any
pointer (otherwise most C programs would break when compiled with a C99
compiler). The pointers used in the examples you gave did not have this
qualifier.
Ludovic.
[1] Fortunately, someone had the good idea to keep a copy of the
standard on the web: http://www.nirvani.net/docs/ansi_c.pdf . ;-)
- Re: Contribution to the Hurd on L4, Marcus Brinkmann, 2005/01/06
- Re: Contribution to the Hurd on L4, Matthieu Lemerre, 2005/01/06
- Re: Contribution to the Hurd on L4,
Ludovic Courtès <=
- Re: Contribution to the Hurd on L4, Marcus Brinkmann, 2005/01/07
- Re: Contribution to the Hurd on L4, David Leimbach, 2005/01/08
- C99 aliasing rules, Ludovic Courtès, 2005/01/10
- Re: C99 aliasing rules, Marcus Brinkmann, 2005/01/10
- Re: C99 aliasing rules, Philip Nilsson, 2005/01/14