RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1336419 - nfsd: Remove some warnings nfsd.c
Summary: nfsd: Remove some warnings nfsd.c
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-16 12:28 UTC by Steve Dickson
Modified: 2016-11-04 05:03 UTC (History)
4 users (show)

Fixed In Version: nfs-utils-1.3.0-0.27.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 05:03:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2383 0 normal SHIPPED_LIVE nfs-utils bug fix and enhancement update 2016-11-03 13:53:02 UTC

Description Steve Dickson 2016-05-16 12:28:19 UTC
Description of problem:

It would be nice to remove a couple compile warnings with
this upstream commit:

commit a2e431fdd114f2c2466573471dafef9024392f2d
Author: Steve Dickson <steved>
Date:   Wed Apr 30 12:26:06 2014 -0400

    nfsd: Remove some warnings nfsd.c
    
    nfsd.c:347:15: warning: comparison between signed and unsigned integer
    expressions [-Wsign-compare]
    nfsd.c:385:13: warning: comparison between signed and unsigned integer
    expressions [-Wsign-compare]
    
    Signed-off-by: Steve Dickson <steved>

diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index 73d6a92..03e3c81 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -101,7 +101,7 @@ main(int argc, char **argv)
        int     count = NFSD_NPROC, c, i, error = 0, portnum = 0, fd, found_one;
        char *p, *progname, *port, *rdma_port = NULL;
        char **haddr = NULL;
-       unsigned int hcounter = 0;
+       int hcounter = 0;
        int     socket_up = 0;
        unsigned int minorvers = 0;

Comment 4 Yongcheng Yang 2016-09-01 08:04:57 UTC
Have verified the warning disappeared with latest nfs-utils
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-----------------------------------------------------------
[yoyang@fs-qe nfsd]$ make clean ; make 
rm -rf .libs _libs
 rm -f nfsd
rm -f *.o
rm -f *.lo
gcc -DHAVE_CONFIG_H -I. -I../../support/include  -I/usr/include/tirpc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2 -MT nfsd.o -MD -MP -MF .deps/nfsd.Tpo -c -o nfsd.o nfsd.c
mv -f .deps/nfsd.Tpo .deps/nfsd.Po
gcc -DHAVE_CONFIG_H -I. -I../../support/include  -I/usr/include/tirpc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2 -MT nfssvc.o -MD -MP -MF .deps/nfssvc.Tpo -c -o nfssvc.o nfssvc.c
mv -f .deps/nfssvc.Tpo .deps/nfssvc.Po
/bin/sh ../../libtool  --tag=CC   --mode=link gcc -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2   -o nfsd nfsd.o nfssvc.o ../../support/nfs/libnfs.a -ltirpc 
libtool: link: gcc -Wall -Wextra -Wstrict-prototypes -pipe -g -O2 -o nfsd nfsd.o nfssvc.o  ../../support/nfs/libnfs.a -ltirpc
[yoyang@fs-qe nfsd]$ 


And it can be reproduced before the patch merged:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------------------------------
[yoyang@fs-qe nfsd]$ make clean ; make
rm -rf .libs _libs
 rm -f nfsd
rm -f *.o
rm -f *.lo
gcc -DHAVE_CONFIG_H -I. -I../../support/include  -I/usr/include/tirpc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2 -MT nfsd.o -MD -MP -MF .deps/nfsd.Tpo -c -o nfsd.o nfsd.c
nfsd.c: In function ‘main’:
nfsd.c:347:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  } while (++i < hcounter); 
               ^
nfsd.c:385:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0; i < hcounter; i++)
             ^
mv -f .deps/nfsd.Tpo .deps/nfsd.Po
gcc -DHAVE_CONFIG_H -I. -I../../support/include  -I/usr/include/tirpc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2 -MT nfssvc.o -MD -MP -MF .deps/nfssvc.Tpo -c -o nfssvc.o nfssvc.c
mv -f .deps/nfssvc.Tpo .deps/nfssvc.Po
/bin/sh ../../libtool  --tag=CC   --mode=link gcc -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2   -o nfsd nfsd.o nfssvc.o ../../support/nfs/libnfs.a -ltirpc 
libtool: link: gcc -Wall -Wextra -Wstrict-prototypes -pipe -g -O2 -o nfsd nfsd.o nfssvc.o  ../../support/nfs/libnfs.a -ltirpc
[yoyang@fs-qe nfsd]$ 


So move on to VERIFIED

Comment 6 errata-xmlrpc 2016-11-04 05:03:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2383.html


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