ARM Technical Support Knowledge Articles

MODIFYING CONSTANT STRUCTURES

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOMS

I have written the following code:

const struct
{
  int i;
} mystruct;

void foo(void)
{
  mystruct.i = 3;
}

No warning or error is generated by the compiler even though I am modifying a constant structure.

CAUSE

This is an omission in the compiler and a warning or error should be generated. This will be fixed in a future version of the compiler.

Article last edited on: 2004-06-15 10:39:59

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