EmbeddedRelated.com
Forums

C programming on ARM

Started by aamer January 30, 2008
Hi all,

How can I correct the following error on ARM7 with C programming?

'=': implicit cast of pointrt to non-equal pointer

thx and regards


aamer wrote:

> How can I correct the following error on ARM7 with C programming? > > '=': implicit cast of pointrt to non-equal pointer
Use two pointers of the same type.
"Arlet Ottens" <usenet+5@c-scape.nl> wrote in message 
news:47a06e44$0$85779$e4fe514c@news.xs4all.nl...
> aamer wrote: > >> How can I correct the following error on ARM7 with C programming? >> >> '=': implicit cast of pointrt to non-equal pointer > > Use two pointers of the same type.
Or cast to the correct type (if you are sure and know what you're doing). -- Posted via a free Usenet account from http://www.teranews.com
On 2008-01-30, Jim Relsh <jrelish@gmail.com> wrote:
> > "Arlet Ottens" <usenet+5@c-scape.nl> wrote in message > news:47a06e44$0$85779$e4fe514c@news.xs4all.nl... >> aamer wrote: >> >>> How can I correct the following error on ARM7 with C programming? >>> >>> '=': implicit cast of pointrt to non-equal pointer >> >> Use two pointers of the same type. > > Or cast to the correct type (if you are sure and know what you're doing).
If he knew what he was doing, he wouldn't have posted that question. ;) -- Grant Edwards grante Yow! Is this an out-take at from the "BRADY BUNCH"? visi.com
Jim Relsh wrote:
> "Arlet Ottens" <usenet+5@c-scape.nl> wrote in message >> aamer wrote: >> >>> How can I correct the following error on ARM7 with C programming? >>> >>> '=': implicit cast of pointrt to non-equal pointer >> >> Use two pointers of the same type. > > Or cast to the correct type (if you are sure and know what you're > doing).
Caution. Most pointer casts are implementation defined. The exception is casting to and from void*, and from void* back to the original type. -- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: <http://cbfalconer.home.att.net> Try the download section. -- Posted via a free Usenet account from http://www.teranews.com
On Jan 30, 5:28=A0pm, "aamer" <raqeeb...@yahoo.com> wrote:
> Hi all, > > How can I correct the following error on ARM7 with C programming? > > '=3D': implicit cast of pointrt to non-equal pointer >
Try proper casting. Karthik Balaguru
On Wed, 30 Jan 2008 11:48:01 -0500, CBFalconer <cbfalconer@yahoo.com>
wrote:

>Jim Relsh wrote: >> "Arlet Ottens" <usenet+5@c-scape.nl> wrote in message >>> aamer wrote: >>> >>>> How can I correct the following error on ARM7 with C programming? >>>> >>>> '=': implicit cast of pointrt to non-equal pointer >>> >>> Use two pointers of the same type. >> >> Or cast to the correct type (if you are sure and know what you're >> doing). > >Caution. Most pointer casts are implementation defined. The >exception is casting to and from void*, and from void* back to the >original type.
In which case would an arbitrary pointer casting be a problem ? The only situation I can think of is for instance some DSP with 24 bit addressable unit or some old 36 bit mainframe, in which for instance a char* would require the memory word and also information which quarter word is referenced. With any byte addressable architecture, a pointer is just a pointer. Paul
Paul Keinanen wrote:

> In which case would an arbitrary pointer casting be a problem ?
Roughly all of them. The real question is how violently the problem will show itself. Some of them can lie dormant for a decade before a platform change exposes them as total show-stoppers.
> With any byte addressable architecture, a pointer is just a pointer.
But there are quite a few non-byte addressable architectures out there. Including ARM, last I checked.
On Jan 30, 10:50 pm, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de>
wrote:

> > With any byte addressable architecture, a pointer is just a pointer. > > But there are quite a few non-byte addressable architectures out there. > Including ARM, last I checked.
Actually, ARM cores are capable of byte addressing (at least any of the currently supported architectures). Some ARM devices may have restrictions on certain types of memory, though.
"Hans-Bernhard Br&#4294967295;ker" <HBBroeker@t-online.de> wrote in message news:fnqrev$3ei$01$1@news.t-online.com...
> Paul Keinanen wrote: > >> In which case would an arbitrary pointer casting be a problem ? > > Roughly all of them. The real question is how violently the problem will show itself. Some of them can lie dormant > for a decade before a platform change exposes them as total show-stoppers. > >> With any byte addressable architecture, a pointer is just a pointer. > > But there are quite a few non-byte addressable architectures out there. > Including ARM, last I checked.
Actually most architectures are byte addressable, including ARM, so casting pointers just works. Of course it's essential to know what you're doing - well written programs rarely need pointer casts. Wilco