Weird Anomaly in GCC

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Weird Anomaly in GCC

Post by mikep »

I have exactly the same code compiled first with ZX24n and then with a ZX1281n. I have verbose output and keep files turned on.

The ZX1281n compile displays the warning:

Code: Select all

warning: cast from pointer to integer of different size
whenever stringTbl[] is referenced. The output C source file and GCC command invocations are the same apart from the device name. Most people will not see this problem and it doesn't affect the execution to my knowledge.
Mike Perks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Weird Anomaly in GCC

Post by dkinzer »

mikep wrote:The ZX1281n compile displays the warning:

Code: Select all

warning:cast from pointer to integer of different size
whenever stringTbl[] is referenced.
That was fixed in the updated zxlib.h that I posted a few days ago.

The reason that it is different for the two devices is the fact that a Flash address is a 32-bit value internally on devices with more than 64K of Flash and a 16-bit value otherwise.
- Don Kinzer
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

Ok that fixed it. It was news to me that a new compiler and zxlib.h existed. The download page still shows 2.5.3.

BTW the zxlib.h is commented as 2.5.3 instead of 2.5.4. This file is normally shipped with the zxlib package and not the compiler although I see why it is required.
Mike Perks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

mikep wrote:It was news to me that a new compiler and zxlib.h existed. The download page still shows 2.5.3.
The only "announcement" was in Paul's ISR post where it was described as an experimental (read "not fully tested") version.
mikep wrote:This file is normally shipped with the zxlib package and not the compiler although I see why it is required.
That is true. However, inasmuch as both elements were required and it was an experimental release, it seemed simpler to package them together.
- Don Kinzer
Post Reply