ARM Technical Support Knowledge Articles

WARNING 276 (CONSTANT IN CONDITION EXPRESSION)

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

When I compile my C source file I get the following warning:

WARNING 276: CONSTANT IN CONDITION EXPRESSION

What causes this?

ANSWER

The compiler detected a conditional expression with a constant value. In most cases this is a typing error. For example:

void test (void)
  {
  int i1, i2, i3;

  if (i1 = 1) i2 = 3;    /* const assigned with = */
  while (i3 = 2);        /* const assigned with = */
  }

MORE INFORMATION

Article last edited on: 2006-10-24 12:21:16

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