redundant test: constant expression is non-zero
#1

Код:
#define abs(%0) ((%0 < 0) ? (-(%0)) : (%0))

new variable = abs(-5);
gives

Код:
warning 206: redundant test: constant expression is non-zero
why? This warning shows with every number.

P.S. please don't give me codes like this.
Код:
if(var < 0) return -var; else return var;
I need to do this with condition operator.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)