OpenSolaris

Printable Version Enter a New Search
Bug ID 6309273
Synopsis gcc and cpr don't get along
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:cpr
Keywords non-regression | oss-bite-size | other_escape | tonic-gcc | triaged
Sponsor
Submitter
Responsible Engineer Kelly Moyer
Reported Against
Duplicate Of
Introduced In
Commit to Fix snv_29
Fixed In snv_29
Release Fixed solaris_nevada(snv_29)
Related Bugs
Submit Date 10-August-2005
Last Update Date 24-January-2006
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]
Work Around
N/A
Comments
N/A