Keil Logo

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


Information in this article applies to:

  • C51 Version 6.00

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

Last Reviewed: Sunday, March 12, 2000


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.