RAD Studio
ContentsIndex
PreviousUpNext
W8008: Condition is always true OR W8008 Condition is always false

(Command-line option to suppress warning: -w-ccc) 

Whenever the compiler encounters a constant comparison that (due to the nature of the value being compared) is always true or false, it issues this warning and evaluates the condition at compile time. 

For example:

  void proc(unsigned x){
    if (x >= 0)        /* always 'true' */
    {
       ...
    }
  }
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!