VMS Help  —  CC  Messages  QUESTCOMPARE
 Message        <Context> the unsigned expression "<expr>" is being
                compared with a relational operator to a constant
                whose value is not greater than zero.  This might not
                be what you intended.

 Description    An ordered comparison between an unsigned value and a
                constant that is less than or equal to zero often
                indicates a programming error.  Humans consider an
                unsigned value to be larger than any negative value.
                But in C a negative value is converted to an unsigned
                value before the comparison, so any negative value
                compares larger than most unsigned values.  An
                ordered comparison of an unsigned value to zero
                suggests a programming error because the value can
                only be greater than or equal to zero.  If the code
                is correct, the comparison could be more clearly
                coded by testing for equality with zero.

 User Action    Cast (or otherwise rewrite) one of the operands of
                the compare to match the signedness of the other
                operand, or compare for equality with zero.
Close Help