Compiler warning in osrf_utf8.c

Bug #954059 reported by Jason Stephenson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSRF
Fix Released
Undecided
Unassigned

Bug Description

Compiling osrf_utf8.c generates the following warning:

osrf_utf8.c:510:29: warning: utf8_char may be used uninitialized in this function [-Wuninitialized]

Revision history for this message
Dan Scott (denials) wrote :

Also, using clang as the compiler results in 4 warnings like the following:

osrf_list.c:106:23: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if(!list || position < 0) return NULL;
                    ~~~~~~~~ ^ ~

(Explanation: "position" is an unsigned int; thus the comparison to < 0 can never evaluate to true).

Changed in opensrf:
milestone: none → 2.1.0-alpha
Revision history for this message
Dan Scott (denials) wrote :

Pushed two commits, one to fix each warning, to user/dbs/lp954059_compiler_warnings

tags: added: pullrequest
Revision history for this message
Galen Charlton (gmc) wrote :

collab/gmcharlt/lp954059_compiler_warnings in the OpenSRF working repo contains sign-offs of the two patches plus a follow-up to clean up some callers of osrfList* functions that should be using an unsigned for list indexes.

Revision history for this message
Dan Scott (denials) wrote :

Thanks, Galen! Pushed to master and rel_2_1.

Changed in opensrf:
status: New → Fix Committed
Dan Scott (denials)
Changed in opensrf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.