ARM Technical Support Knowledge Articles


Applies to: C51 C Compiler


Information in this article applies to:


I have written the following code:

extern struct S foo;

void main(void)

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.


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.


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

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