ARM Technical Support Knowledge Articles

ERROR 141 (TOO MANY INITIALIZERS)

Applies to: General Topics

Answer


Information in this article applies to:


QUESTION

I have declared the following array:

const char blah[] = {"fd", 0x34};

When I compile my file I get:

ERROR 141: TOO MANY INITIALIZERS.

Why and how do I fix this?

ANSWER

This error was not generated in older versions of the compiler, but it has been introduced to avoid invalid initializations of an array.

You must change your declaration to:

const char blah[] = {"fd" "x34"};

Note that the comma has been removed.

Alternatively, you can use a structure instead of the array to associate a string with a value.

Article last edited on: 2004-06-09 15:37:35

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