ARM Technical Support Knowledge Articles

ERROR 230 (UNKNOWN STRUCT/UNION/ENUM TAG)

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOMS

I have written the following code:

extern struct S foo;

void main(void)
{
  while(1);
}

It generates the following error from the compiler:

ERROR 230 IN LINE 6 OF TEST.C: 'S': unknown struct/union/enum tag

The structure is defined in another source file so why is it generating this error?

It doesn't generate the error if I declare a pointer to struct S.

CAUSE

This is a bug in the compiler and the error should only be generated if you try to access the structure (as the type struct S has not been defined in the scope of the source file).

This will be fixed in the next version of the compiler.

RESOLUTION

As a workaround place the structure declaration of S in a header file and include it in all source files that use that type.

Article last edited on: 2004-06-15 15:33:32

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