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:


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@redhat.com>
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@redhat.com>

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.