Compiler warning and highlighting failure

Stefan Valouch stefan at valouch.de
Fri Aug 14 14:48:44 UTC 2009


Hi,

While looking at compiler warnings from kdevelop, i stumbled upon an 
interesting warning:
"comparison is always true due to limited range of data type"
It is located here: kdevelop/debuggers/gdb/mi/milexer.cpp line 137 and looks 
as follows:
 (this->*s_scan_table[ch < 128 ? ch : 128])(&kind);
If i recall correct, a chars value range is –128 to 127.
As m_contents is a QByteArray, i assume that the char "ch" should be of type 
unsigned char.
Am i correct?

On the same position there's a slight bug in highlighting: In the shortened 
if-statement, the value for true (the "ch") is not highlighted (both 
kdevplatform and kdevelop from trunk).
Screenshot: 
http://valouch.info/screen/kde/bugs/kdevelop/highlighting_and_compilerwarning_always_true.png
Should i open a bugreport on this?

btw: Just got an account for svn :-)

Stefan




More information about the KDevelop-devel mailing list