cancel
Showing results for 
Search instead for 
Did you mean: 

COSMIC question

pete3
Associate II
Posted on September 21, 2006 at 12:09

COSMIC question

3 REPLIES 3
pete3
Associate II
Posted on September 21, 2006 at 08:54

Hello COSMIC gurus. What is wrong with the following code?

union

{

unsigned int i;

unsigned int * p;

struct

{

unsigned char h;

unsigned char l;

} b;

} pt;

The error is in the pointer declaration. I have tried modifying this with the @near directive (since I want a 2-byte pointer) but no luck. The compiler tells me a member is missing. Removing the pointer declaration makes the compiler happy. I'm quite confused because I've used unions before with this compiler without problems.

I am using V4.5.5 (eval) and the target is a 72F521R9.

pete3
Associate II
Posted on September 21, 2006 at 09:18

Forget that. Just had to use a variable name bigger than one character.

pete3
Associate II
Posted on September 21, 2006 at 12:09

... as the program includes this line:

#define p 5

!