ARM Technical Support Knowledge Articles

PROBLEMS ACCESSING STRUCTURES USING POINTERS

Applies to: C166 C Compiler

Answer


Information in this article applies to:


SYMPTOMS

I have declared a structure and located it at 2000H using the HVAR macro. I then tried to access an element of the array using a pointer:

typedef struct S1_S
{
  int i1;
  int i2;
  long l1;
  long l2;
  char c1;
  char c2;
} S1;

#define S1_var HVAR( S1, 0x2000 )

long *P_long = &S1_var.l2;

Assigning values to the pointer doesn't work.

CAUSE

This is a bug in the compiler and you require version 4.05 of the C166 compiler or better.

RESOLUTION

Download and install version C166 4.05 or later. You may download the latest updates from the Keil Website.

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2003-03-20 20:42:58

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential