Bug 1336268 - features/index: clang compile warnings in index.c
Summary: features/index: clang compile warnings in index.c
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: index
Version: 3.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ravishankar N
QA Contact:
URL:
Whiteboard:
Depends On: 1335232
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-16 04:21 UTC by Ravishankar N
Modified: 2016-06-16 14:06 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Clone Of: 1335232
Environment:
Last Closed: 2016-06-16 14:06:58 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Ravishankar N 2016-05-16 04:21:41 UTC
+++ This bug was initially created as a clone of Bug #1335232 +++

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:

--- Additional comment from Vijay Bellur on 2016-05-13 01:29:14 EDT ---

REVIEW: http://review.gluster.org/14318 (index: Fix compiler warning) posted (#1) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Vijay Bellur on 2016-05-13 03:12:59 EDT ---

REVIEW: http://review.gluster.org/14318 (index: Fix compiler warning) posted (#2) for review on master by Ravishankar N (ravishankar)

--- Additional comment from Vijay Bellur on 2016-05-13 18:06:15 EDT ---

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 1 Vijay Bellur 2016-05-16 04:22:36 UTC
REVIEW: http://review.gluster.org/14346 (index: Fix compiler warning) posted (#1) for review on release-3.8 by Ravishankar N (ravishankar)

Comment 2 Vijay Bellur 2016-05-23 08:54:42 UTC
REVIEW: http://review.gluster.org/14346 (index: Fix compiler warning) posted (#2) for review on release-3.8 by Niels de Vos (ndevos)

Comment 3 Vijay Bellur 2016-05-24 08:33:01 UTC
COMMIT: http://review.gluster.org/14346 committed in release-3.8 by Niels de Vos (ndevos) 
------
commit b128a8983376c70b6f9f35ed60d54404da314624
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:
    Add a -1 value in the enumeration and use that in if-statements.
    
    Cherry picked from commit e221827c18ad4161a8e54ad67c9128ad234b8c03:
    > 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>
    
    The backport prevens the need for commit 137bd83 to be backported.
    Commit e221827 undoes the ugly type-casting.
    
    Change-Id: I65911a05de5f8b5634f1e8cf359c38dad7d125aa
    BUG: 1336268
    Signed-off-by: Ravishankar N <ravishankar>
    Signed-off-by: Niels de Vos <ndevow>
    Reviewed-on: http://review.gluster.org/14346
    Tested-by: Niels de Vos <ndevos>
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>

Comment 4 Niels de Vos 2016-06-16 14:06:58 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.8.0, please open a new bug report.

glusterfs-3.8.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://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.