C4000: Condition always is TRUE

[DISABLE, INFORMATION , WARNING, ERROR]

Description

The compiler has detected a condition to be always true. This may also happen if the compiler uses high level optimizations, but could also be a hint for a possible programming error.

Example
  unsigned int i= 2;

  
  ...

  
  if (i >= 0) i = 1;

  

Example
  extern void work(void);

  
  void test(void) {

  
    while (1) {

  
      work();

  
    }

  
  }

  
Tips

If it is a programming error, correct the statement. For endless loops, use for (;;) ... instead of while (1).

  extern void work(void);

  
  void test(void) {

  
    for (;;) {

  
      work();

  
    }

  
  }