|
Description
|
cpr has some code-quality issues that cause gcc to issue warnings and
may be indicative of actual bugs. To wit:
1. Incorrect format strings in debug output. Primarily these are missing
or extra 'l' qualifiers, or confusion between %p and %lx.
2. Casts between pointers and integers of different sizes. The standard
does not specify whether these cause sign-extension; gcc sign extends and
warns while Studio does neither. To be safe, correct code should first
cast to an integer type the same length as a pointer. Use intptr_t to
trigger sign-extension or uintptr_t to preserve Studio behaviour.
3. Missing returns. gcc does not recognise NOTREACHED and will complain if
not all code paths through a function return a value.
See suggested fix for more detail.
[oss-bite-size]
|