Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Strange Compiler Behaviour -

2005-02-24 by Mark Butcher

Hi Robert

OK - you were right. It was working on the Windows PC because the 
module is really getting its memory from heap and uses a pointer. 
The other declaration (static array) was also working but only by 
chance since it was setting and collecting from a 'free' location.

I realised that the target build (testing a new module) was using a 
previous base still with static arrays and so the new module was 
failing.

At least I had the change to get my head around and now it's clear.

Regards

Mark Butcher

www.mjbc.ch

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> 
wrote:
> At 04:42 PM 2/23/05 +0000, Mark Butcher wrote:
> >extern IDINFO que_ids[]; and extern IDINFO *que_ids; should be
> >equivalent as far as I am aware and this is the first instance 
where
> >I have found two compilers producing completely different code 
(one
> >seemingly false).
> 
> They are not equivalent.  The first is the name of an array, the 
second is 
> a pointer to an element.  The first gets replaced by the linker 
with a 
> reference to the array location in memory, the second by a 
reference to a 
> pointer to a location in memory.
> 
> What you are probably thinking of are the fact that array syntax 
and 
> pointer syntax can be used interchangeably in many circumstances.  
This is 
> one of the exceptions.
> 
> Robert
> 
> " 'Freedom' has no meaning of itself.  There are always 
restrictions,
> be they legal, genetic, or physical.  If you don't believe me, try 
to
> chew a radio signal. "
> 
>                          Kelvin Throop, III

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.