RAD Studio |  |

W8008: Condition is always true OR W8008 Condition is always false (C++)

(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:

Copy Code

      void proc(unsigned x){
        if (x >= 0)        /* always 'true' */
        {
           ...
        }
      }

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!