no swim no life

warning: comparison is always false due to limited range of data type 본문

work/error

warning: comparison is always false due to limited range of data type

달려간다 2009. 1. 21. 14:14
warning: comparison is always false due to limited range of data type

gcc에서 아래와 같은 코드가 해당 경고를 발생시킬 수 있다.

unsigned char btFlag;

...

if ( btFlag < 0 )

btFlag는 unsigned 이므로 항상 false 이다.

무심코 넘어갈 수 있는 부분 

'work > error' 카테고리의 다른 글

error C2632: 'long' followed by 'long' is illegal  (2) 2009.02.09
warning: no newline at end of file  (0) 2009.01.05
WINVER not defined. Defaulting to 0x0501  (0) 2008.11.06
Comments