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 1377560 - Compiler warning: unused variable 'i' [-Wunused-variable]
Summary: Compiler warning: unused variable 'i' [-Wunused-variable]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpcbind
Version: 7.3
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: ChunYu Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-20 06:12 UTC by ChunYu Wang
Modified: 2017-08-01 18:36 UTC (History)
3 users (show)

Fixed In Version: rpcbind-0.2.0-39.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 18:36:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1992 0 normal SHIPPED_LIVE rpcbind bug fix update 2017-08-01 18:10:39 UTC

Comment 4 ChunYu Wang 2017-02-27 08:19:15 UTC
If we just delete this declaration of 'i', the other 'i' instances in for loops will get error with undeclared variable 'i', maybe it is better to change i = 0 into int i = 0 in each loop, this will both avoid the original unused 'i' problem and comply to C99 standard.
 
[chunwang@fs-qe src]$ cat ./rpcb_svc_com.c  |egrep SVC_RUN_DEBUG -A 5
#ifdef SVC_RUN_DEBUG
	int i;
#endif
	register struct pollfd	*p;
	fd_set cleanfds;

--
#ifdef SVC_RUN_DEBUG
		if (debugging) {
			fprintf(stderr, "polling for read on fd < ");
			for (i = 0, p = pollfds; i < nfds; i++, p++)
				if (p->events)
					fprintf(stderr, "%d ", p->fd);
--
#ifdef SVC_RUN_DEBUG
			if (debugging) {
				fprintf(stderr, "poll returned read fds < ");
				for (i = 0, p = pollfds; i < nfds; i++, p++)
					if (p->revents)
						fprintf(stderr, "%d ", p->fd);
--
<--snip-->
[chunwang@fs-qe rpcbind]$ cat ./rpcbind-0.2.0-i-warn.patch
diff -up rpcbind-0.2.0/src/rpcb_svc_com.c.orig rpcbind-0.2.0/src/rpcb_svc_com.c
--- rpcbind-0.2.0/src/rpcb_svc_com.c.orig	2017-02-25 14:47:09.839325988 -0500
+++ rpcbind-0.2.0/src/rpcb_svc_com.c	2017-02-25 14:47:57.424187563 -0500
@@ -1106,9 +1106,6 @@ my_svc_run()
 	struct pollfd pollfds[FD_SETSIZE];
 	int poll_ret, check_ret;
 	int n;
-#ifdef SVC_RUN_DEBUG
-	int i;
-#endif
 	register struct pollfd	*p;
 	fd_set cleanfds;

Comment 5 Steve Dickson 2017-02-27 23:09:02 UTC
(In reply to ChunYu Wang from comment #4)
> If we just delete this declaration of 'i', the other 'i' instances in for
> loops will get error with undeclared variable 'i', maybe it is better to
> change i = 0 into int i = 0 in each loop, this will both avoid the original
> unused 'i' problem and comply to C99 standard.
No. If that was true there would not have been a warning.
Plus those other SVC_RUN_DEBUG are in different routine.

Comment 7 ChunYu Wang 2017-03-13 03:24:57 UTC
Moved to VERIFIED according to Comment 6, will keep an eye on related issues in future erratas.

Comment 8 errata-xmlrpc 2017-08-01 18:36:03 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://access.redhat.com/errata/RHBA-2017:1992


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