ARM Technical Support Knowledge Articles

ERROR 200 (LEFT SIDE OF '.' REQUIRES STRUCT/UNION)

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOMS

C51 Version 6 generates the following error message when I compile my old Version 5 code.

*** ERROR 200 IN LINE 10 OF .MAIN.C: left side of '.' requires struct/union

What's wrong?

CAUSE

C51 V5.x accepted some structure pointer operations without generating syntax errors. For example:

The following code works fine in C51 V5.x.

   1          struct s { char v; };
   2
   3          void func (struct s *sp)  {
   4   1        sp.v = 0;
   5   1      }

However, it generates the above error in C51 V6.x.

RESOLUTION

To fix this problem, check your structure pointer accesses to be sure that the points-to operator (->) is used instead of the dot operator (.).

In the above example, the syntax sp.v needs to be replace with sp->v.

   1          struct s { char v; };
   2
   3          void func (struct s *sp)  {
   4   1        sp->v = 0;
   5   1      }

SEE ALSO

Article last edited on: 2000-03-12 00:00:00

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