Re: C programming on ARM
- From: Stefan Reuther <stefan.news@xxxxxxxx>
- Date: Thu, 31 Jan 2008 19:01:15 +0100
Wilco Dijkstra wrote:
"Grant Edwards" <grante@xxxxxxxx> wrote in message news:13q21msqkij3dbb@xxxxxxxxxxxxxxxxxxxxx
so casting pointers just works.
Unless the resulting pointer is misaligned.
Or the pointer is aligned but points to the wrong place, or invalid memory,
or a peripheral, or ... If you don't know what you're doing then pointer
casting is likely the least of your problems.
My point was that the bitpatterns of all pointer types are the same for
all addresses in the address space.
If they are in the same address space. "void*" (and therefore "char*")
is guaranteed to be able to point at any data item, but there still are
function pointers, which can live in a completely different address
space. The simplest example is our beloved i386 architecture, where data
pointers can be between 16 and 48 bits, code pointers too, but not
necessarily the same size as the others.
Stefan
.
- References:
- C programming on ARM
- From: aamer
- Re: C programming on ARM
- From: Arlet Ottens
- Re: C programming on ARM
- From: Jim Relsh
- Re: C programming on ARM
- From: CBFalconer
- Re: C programming on ARM
- From: Paul Keinanen
- Re: C programming on ARM
- From: Hans-Bernhard Bröker
- Re: C programming on ARM
- From: Wilco Dijkstra
- Re: C programming on ARM
- From: Grant Edwards
- Re: C programming on ARM
- From: Wilco Dijkstra
- C programming on ARM
- Prev by Date: Re: PCB Thermal Analysis
- Next by Date: Re: Casting function pointers
- Previous by thread: Re: C programming on ARM
- Next by thread: Re: C programming on ARM
- Index(es):
Relevant Pages
|