From stefan@fafoe.dyndns.org  Fri Sep  5 08:09:39 2003
Return-Path: <stefan@fafoe.dyndns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2CD5316A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Sep 2003 08:09:39 -0700 (PDT)
Received: from fafoe.narf.at (chello212186121237.14.vie.surfer.at [212.186.121.237])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1CC8F43F85
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Sep 2003 08:09:38 -0700 (PDT)
	(envelope-from stefan@fafoe.dyndns.org)
Received: from frog.fafoe.narf.at (frog.fafoe.narf.at [192.168.2.101])
	by fafoe.narf.at (Postfix) with ESMTP
	id 6425D3FA9; Fri,  5 Sep 2003 17:09:35 +0200 (CEST)
Received: by frog.fafoe.narf.at (Postfix, from userid 1001)
	id 2DEF8318; Fri,  5 Sep 2003 17:09:35 +0200 (CEST)
Message-Id: <20030905150935.2DEF8318@frog.fafoe.narf.at>
Date: Fri,  5 Sep 2003 17:09:35 +0200 (CEST)
From: Stefan Farfeleder <stefan@fafoe.narf.at>
Reply-To: Stefan Farfeleder <stefan@fafoe.narf.at>
To: FreeBSD-gnats-submit@freebsd.org
Cc: stefan@fafoe.narf.at
Subject: [patch] Removal of stray semicolons after functions in elfdump
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56492
>Category:       bin
>Synopsis:       [patch] Removal of stray semicolons after functions in elfdump
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    schweikh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 05 08:10:13 PDT 2003
>Closed-Date:    Sat Dec 20 05:07:27 PST 2003
>Last-Modified:  Sat Dec 20 05:07:27 PST 2003
>Originator:     Stefan Farfeleder
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD frog.fafoe.narf.at 5.1-CURRENT FreeBSD 5.1-CURRENT #6: Thu Aug 28 12:17:45 CEST 2003 freebsd@frog.fafoe.narf.at:/freebsd/frog/obj/freebsd/frog/src/sys/FROG i386


	
>Description:
In src/usr.bin/elfdump/elfdump.c three functions are terminated by a
semicolon.  But a semicolon after a function actually constitutes an emtpy
declaration which violates a constraint in C89 and C99.
	
>How-To-Repeat:
Compile it with a compliant compiler:

$ c89 -c elfdump.c
[...]
elfdump.c:241: warning: ISO C does not allow extra `;' outside of a function
[...]
$ tcc -Ysystem -c elfdump.c
"elfdump.c", line 243: Error:
  [ISO 6.5]: Can't have empty declaration.
[...]
	
>Fix:

	

--- elfdump.diff begins here ---
Index: src/usr.bin/elfdump/elfdump.c
===================================================================
RCS file: /usr/home/ncvs/src/usr.bin/elfdump/elfdump.c,v
retrieving revision 1.9
diff -u -r1.9 elfdump.c
--- src/usr.bin/elfdump/elfdump.c	9 Aug 2003 01:55:37 -0000	1.9
+++ src/usr.bin/elfdump/elfdump.c	5 Sep 2003 14:41:25 -0000
@@ -238,7 +238,7 @@
 	case 0x7fffffff: return "DT_SUNW_FILTER";
 	default: return "ERROR: TAG NOT DEFINED";
 	}
-};
+}
 
 static const char *
 e_machines(u_int mach)
@@ -256,7 +256,7 @@
 	case EM_IA_64:	return "EM_IA_64";
 	}
 	return "(unknown machine)";
-};
+}
 
 const char *e_types[] = {
 	"ET_NONE", "ET_REL", "ET_EXEC", "ET_DYN", "ET_CORE"
@@ -327,7 +327,7 @@
 	/* 0x80000000 - 0xffffffff application programs */
 	default: return "ERROR: SHT NOT DEFINED";
 	}
-};
+}
 
 const char *sh_flags[] = {
 	"", "SHF_WRITE", "SHF_ALLOC", "SHF_WRITE|SHF_ALLOC", "SHF_EXECINSTR",
--- elfdump.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: schweikh 
State-Changed-When: Sat Sep 6 03:55:44 PDT 2003 
State-Changed-Why:  
Applied to -current. Thanks! 


Responsible-Changed-From-To: freebsd-bugs->schweikh 
Responsible-Changed-By: schweikh 
Responsible-Changed-When: Sat Sep 6 03:55:44 PDT 2003 
Responsible-Changed-Why:  
My MFC Reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56492 
State-Changed-From-To: patched->closed 
State-Changed-By: schweikh 
State-Changed-When: Sat Dec 20 05:06:59 PST 2003 
State-Changed-Why:  
Not in RELENG_4, so no need to MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56492 
>Unformatted:
