|
Description
|
The IDN kernel drivers have some code quality problems that trigger
warnings when built with gcc. Some also indicate real bugs. They
fall into these general categories:
1. Useless comparisons. Comparing unsigned types >= 0 or any variable
<= its maximum possible value is useless and causes a warning. In many
cases this is hard to see because the constants being compared are
not literals. Note that DECSPACE is interesting; it's a macro that is
passed more than one type; the comparisons it does are meaningful for
some types and not for others. The suggested fix creates a separate
DECSPACE16 for use with 16-bit variables, but there's probably a better
way.
2. Incorrect format strings in debug output. Mainly these are missing or
extra 'l' qualifiers, confusion between %p and %x or %lx, or missing
or extra arguments.
3. Casts between pointers and integers of different sizes. The standards
do not specify whether such casts cause sign extension; gcc sign-extends
and warns while Studio does neither. The safe way to keep the current
behaviour is to cast to uintptr_t first.
See suggested fix for further details.
[oss-bite-size]
|