Bug 1335232

Summary: features/index: clang compile warnings in index.c
Product: [Community] GlusterFS Reporter: Kaleb KEITHLEY <kkeithle>
Component: indexAssignee: Ravishankar N <ravishankar>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, ndevos
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.9.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1336268 (view as bug list) Environment:
Last Closed: 2017-03-27 18:13:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1336268    

Description Kaleb KEITHLEY 2016-05-11 15:44:57 UTC
Description of problem:

Making all in index
Making all in src
  CC       index.lo
index.c:420:18: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
        if (type < 0 || type >= XATTROP_TYPE_END)
            ~~~~ ^ ~
1 warning generated.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Vijay Bellur 2016-05-13 05:29:14 UTC
REVIEW: http://review.gluster.org/14318 (index: Fix compiler warning) posted (#1) for review on master by Ravishankar N (ravishankar)

Comment 2 Vijay Bellur 2016-05-13 07:12:59 UTC
REVIEW: http://review.gluster.org/14318 (index: Fix compiler warning) posted (#2) for review on master by Ravishankar N (ravishankar)

Comment 3 Vijay Bellur 2016-05-13 22:06:15 UTC
COMMIT: http://review.gluster.org/14318 committed in master by Kaleb KEITHLEY (kkeithle) 
------
commit 137bd83029458ecd461718a891c74cd1afd8f6cb
Author: Ravishankar N <ravishankar>
Date:   Fri May 13 12:41:39 2016 +0530

    index: Fix compiler warning
    
    Problem:
    ----------------------------
    index.c:420:18: warning: comparison of unsigned enum expression < 0 is
    always false [-Wtautological-compare]
            if (type < 0 || type >= XATTROP_TYPE_END)
                ~~~~ ^ ~
    1 warning generated.
    ----------------------------
    Fix:
    Do a type cast before comparing.
    
    Change-Id: I65911a05de5f8b5634f1e8cf359c38dad7d125aa
    BUG: 1335232
    Signed-off-by: Ravishankar N <ravishankar>
    Reviewed-on: http://review.gluster.org/14318
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>

Comment 4 Vijay Bellur 2016-05-18 10:34:04 UTC
REVIEW: http://review.gluster.org/14409 (index: improve compiler warning fix) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 5 Vijay Bellur 2016-05-20 10:22:39 UTC
REVIEW: http://review.gluster.org/14409 (index: improve compiler warning fix) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 6 Vijay Bellur 2016-05-23 08:13:31 UTC
COMMIT: http://review.gluster.org/14409 committed in master by Niels de Vos (ndevos) 
------
commit e221827c18ad4161a8e54ad67c9128ad234b8c03
Author: Niels de Vos <ndevos>
Date:   Wed May 18 12:23:59 2016 +0200

    index: improve compiler warning fix
    
    Commit 137bd83029458ecd461718a891c74cd1afd8f6cb introduced some
    typecasting to work around a compiler warning. It is much cleaner to
    add a -1 value in the enumeration and use that in if-statements.
    
    BUG: 1335232
    Change-Id: I830a565b8d96d7b51ff775e94aa23dd567ffe0d9
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/14409
    Smoke: Gluster Build System <jenkins.com>
    Reviewed-by: Ravishankar N <ravishankar>
    CentOS-regression: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 7 Shyamsundar 2017-03-27 18:13:07 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.9.0, please open a new bug report.

glusterfs-3.9.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/gluster-users/2016-November/029281.html
[2] https://www.gluster.org/pipermail/gluster-users/