From xdivac02@stud.fit.vutbr.cz  Sat Sep 18 09:04:03 2004
Return-Path: <xdivac02@stud.fit.vutbr.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BD1E916A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Sep 2004 09:04:03 +0000 (GMT)
Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 89D6A43D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Sep 2004 09:04:02 +0000 (GMT)
	(envelope-from xdivac02@stud.fit.vutbr.cz)
Received: from eva.fit.vutbr.cz (localhost [127.0.0.1])
	by eva.fit.vutbr.cz (8.12.11/8.12.11) with ESMTP id i8I93vX7041511
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Sep 2004 11:03:57 +0200 (CEST)
Received: (from xdivac02@localhost)
	by eva.fit.vutbr.cz (8.12.11/8.12.5/Submit) id i8I93vne041510;
	Sat, 18 Sep 2004 11:03:57 +0200 (CEST)
Message-Id: <200409180903.i8I93vne041510@eva.fit.vutbr.cz>
Date: Sat, 18 Sep 2004 11:03:57 +0200 (CEST)
From: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
Reply-To: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: making kdump WARNS=6 clean
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71855
>Category:       bin
>Synopsis:       [patch] making kdump(1) WARNS=6 clean
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 18 09:10:13 GMT 2004
>Closed-Date:    Thu Aug 19 19:10:12 UTC 2010
>Last-Modified:  Thu Aug 19 19:10:12 UTC 2010
>Originator:     Divacky Roman
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
home
>Environment:
FreeBSD witten 6.0-CURRENT FreeBSD 6.0-CURRENT #130: Fri Sep 17 18:19:53 CEST
2004     root@witten:/usr/obj/usr/src/sys/NEOLOGISM  i386


	
>Description:
This makes kdump partially WARNS=6 clean... its also necessary to resolve
conflict between pccard/cardinfo.h and sys/memrange.h MDF_ACTIVE define...

>How-To-Repeat:
apply this patch and do "something" with that MDF_ACTIVE define
>Fix:
diff -urN /usr/src/usr.bin/kdump/Makefile kdump/Makefile
--- /usr/src/usr.bin/kdump/Makefile	Tue Jul 23 11:15:45 2002
+++ /usr/src/usr.bin/kdump/Makefile	Sat Sep 18 10:52:49 2004
@@ -6,6 +6,7 @@
 PROG=		kdump
 SRCS=		kdump.c ioctl.c subr.c
 CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR}/../..
+WARNS?= 6
 
 CLEANFILES=	ioctl.c
 
diff -urN /usr/src/usr.bin/kdump/kdump.c kdump/kdump.c
--- /usr/src/usr.bin/kdump/kdump.c	Thu Mar 25 13:33:55 2004
+++ /usr/src/usr.bin/kdump/kdump.c	Sat Sep 18 10:52:49 2004
@@ -79,6 +79,7 @@
 void ktrcsw(struct ktr_csw *);
 void ktruser(int, unsigned char *);
 void usage(void);
+extern const char *ioctlname(register_t);
 
 int timestamp, decimal, fancy = 1, tail, maxdata;
 const char *tracefile = DEF_TRACEFILE;
@@ -285,7 +286,6 @@
 {
 	int narg = ktr->ktr_narg;
 	register_t *ip;
-	const char *ioctlname(u_long);
 
 	if (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0)
 		(void)printf("[%d]", ktr->ktr_code);
--- /usr/src/sys/sys/diskpc98.h	Wed Apr  7 06:19:49 2004
+++ /usr/src/sys/sys/diskpc98.h	Sat Sep 18 10:57:10 2004
@@ -36,9 +36,11 @@
 #include <sys/ioccom.h>
 
 #define	DOSBBSECTOR	0	/* DOS boot block relative sector number */
+#ifdef PC98
 #define	DOSPARTOFF	0
 #define	NDOSPART	16
 #define	DOSPTYP_386BSD	0x94	/* 386BSD partition type */
+#endif
 
 struct pc98_partition {
     	unsigned char	dp_mid;
>Release-Note:
>Audit-Trail:

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/71855: making kdump WARNS=6 clean
Date: Sun, 19 Sep 2004 18:01:29 +0300

 On Sat, Sep 18, 2004 at 11:03:57AM +0200, Divacky Roman wrote:
 > 
 > >Description:
 > This makes kdump partially WARNS=6 clean... its also necessary to resolve
 > conflict between pccard/cardinfo.h and sys/memrange.h MDF_ACTIVE define...
 > 
 > >How-To-Repeat:
 > apply this patch and do "something" with that MDF_ACTIVE define
 > >Fix:
 > diff -urN /usr/src/usr.bin/kdump/Makefile kdump/Makefile
 > --- /usr/src/usr.bin/kdump/Makefile	Tue Jul 23 11:15:45 2002
 > +++ /usr/src/usr.bin/kdump/Makefile	Sat Sep 18 10:52:49 2004
 > @@ -6,6 +6,7 @@
 >  PROG=		kdump
 >  SRCS=		kdump.c ioctl.c subr.c
 >  CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR}/../..
 > +WARNS?= 6
 >  
 >  CLEANFILES=	ioctl.c
 >  
 This is unsafe, please see below.
 
 > diff -urN /usr/src/usr.bin/kdump/kdump.c kdump/kdump.c
 > --- /usr/src/usr.bin/kdump/kdump.c	Thu Mar 25 13:33:55 2004
 > +++ /usr/src/usr.bin/kdump/kdump.c	Sat Sep 18 10:52:49 2004
 > @@ -79,6 +79,7 @@
 >  void ktrcsw(struct ktr_csw *);
 >  void ktruser(int, unsigned char *);
 >  void usage(void);
 > +extern const char *ioctlname(register_t);
 >  
 >  int timestamp, decimal, fancy = 1, tail, maxdata;
 >  const char *tracefile = DEF_TRACEFILE;
 > @@ -285,7 +286,6 @@
 >  {
 >  	int narg = ktr->ktr_narg;
 >  	register_t *ip;
 > -	const char *ioctlname(u_long);
 >  
 >  	if (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0)
 >  		(void)printf("[%d]", ktr->ktr_code);
 > 
 I've committed a variation of this, thanks!
 
 > --- /usr/src/sys/sys/diskpc98.h	Wed Apr  7 06:19:49 2004
 > +++ /usr/src/sys/sys/diskpc98.h	Sat Sep 18 10:57:10 2004
 > @@ -36,9 +36,11 @@
 >  #include <sys/ioccom.h>
 >  
 >  #define	DOSBBSECTOR	0	/* DOS boot block relative sector number */
 > +#ifdef PC98
 >  #define	DOSPARTOFF	0
 >  #define	NDOSPART	16
 >  #define	DOSPTYP_386BSD	0x94	/* 386BSD partition type */
 > +#endif
 >  
 >  struct pc98_partition {
 >      	unsigned char	dp_mid;
 > 
 This won't be committed, as it's bogus.  It's bogus because these
 defines are correct, and the problem you see is elsewhere, not in
 this header.
 
 A kdump(1) is special in that it tries to show as much ioctl names
 as possible.  For this, it dynamically builds a list of all ioctls
 by scanning the system headers and looking for "_IO" defines.  As
 you never know if there will be a conflict in names or not (the
 exact list of headers used is unknown and unpredictable), bumping
 a WARNS level to 6 will likely cause breakages in the future.
 While "it would be nice" to have kdump(1) compile without warnings,
 guaranteeing this in a long term is troublesome.
 
 
 Cheers,
 -- 
 Ruslan Ermilov
 ru@FreeBSD.org
 FreeBSD committer
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Fri Oct 8 05:47:59 GMT 2004 
State-Changed-Why:  
Parts have been committed but the general solution sounds like it 
is problematic. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71855 
State-Changed-From-To: suspended->closed 
State-Changed-By: vwe 
State-Changed-When: Thu Aug 19 19:09:29 UTC 2010 
State-Changed-Why:  
nobody was brave enough to commit, so we're going to close before it's dying old. 

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