Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 2004 15:10:22 GMT
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/71855: making kdump WARNS=6 clean
Message-ID:  <200409191510.i8JFAM28032870@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/71855; it has been noted by GNATS.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409191510.i8JFAM28032870>