Bug 1488909 - Fix the type of 'len' in posix.c, clang is showing a warning
Summary: Fix the type of 'len' in posix.c, clang is showing a warning
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: build
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-06 12:51 UTC by M. Scherer
Modified: 2017-12-08 17:40 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.13.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-08 17:40:26 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description M. Scherer 2017-09-06 12:51:47 UTC
Description of problem:

Building with clang show this warning:

posix.c:133:17: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]

Looking at the code, the problem is that we compare len, a unsigned type to see if that's < 0, which doesn't make sense.

Comment 1 Worker Ant 2017-09-06 12:52:11 UTC
REVIEW: https://review.gluster.org/18220 (Fix the type of len, a warning is triggered) posted (#1) for review on master by Michael Scherer (misc)

Comment 2 Worker Ant 2017-09-08 16:16:58 UTC
COMMIT: https://review.gluster.org/18220 committed in master by Jeff Darcy (jeff.us) 
------
commit c6c526010fa4b9d9628e445036e8f84b00bfb9a8
Author: Michael Scherer <misc>
Date:   Wed Sep 6 14:46:20 2017 +0200

    Fix the type of len, a warning is triggered
    
    clang show this warning on FreeBSD:
    
      posix.c:133:17: warning: comparison of unsigned expression < 0
      is always false [-Wtautological-compare]
    
    A closer look on the code show that sys_readlink is returning a ssize_t,
    not a size_t, who is unsigned.
    
    Change-Id: Idb6a440ea44cc2168b0dd85f791c7955caa67c8c
    BUG: 1488909
    Signed-off-by: Michael Scherer <misc>
    Reviewed-on: https://review.gluster.org/18220
    Tested-by: Michael Scherer <misc>
    CentOS-regression: Gluster Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jeff.us>

Comment 3 Shyamsundar 2017-12-08 17:40:26 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.13.0, please open a new bug report.

glusterfs-3.13.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/announce/2017-December/000087.html
[2] https://www.gluster.org/pipermail/gluster-users/


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