From marcolz@ilse.nl  Sun Dec 23 11:26:39 2001
Return-Path: <marcolz@ilse.nl>
Received: from serv1.ilse.nl (serv1.ilse.nl [195.18.92.131])
	by hub.freebsd.org (Postfix) with ESMTP id AB01E37B416
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 23 Dec 2001 11:26:37 -0800 (PST)
Received: (from marcolz@localhost)
	by crime.ncc1701.org (8.11.6/8.9.3) id fBNJHun02054;
	Sun, 23 Dec 2001 20:17:56 +0100 (CET)
	(envelope-from marcolz)
Message-Id: <200112231917.fBNJHun02054@crime.ncc1701.org>
Date: Sun, 23 Dec 2001 20:17:56 +0100 (CET)
From: Marc Olzheim <marcolz@ilse.nl>
Reply-To: Marc Olzheim <marcolz@ilse.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: empty struct md_coredump in pcb.h and user.h violates strict ansi
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         33117
>Category:       kern
>Synopsis:       [patch] empty struct md_coredump in pcb.h and user.h violates strict ansi
>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:   Sun Dec 23 11:30:00 PST 2001
>Closed-Date:    Wed Mar 16 11:46:54 GMT 2005
>Last-Modified:  Wed Mar 16 11:46:54 GMT 2005
>Originator:     Marc Olzheim
>Release:        FreeBSD 4.5-PRERELEASE i386
>Organization:
ilse technology
>Environment:
System: FreeBSD crime.ncc1701.org 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #0: Sun Dec 23 03:24:54 CET 2001 root@crime.ncc1701.org:/usr/src/sys/compile/crime i386


>Description:
	In /usr/src/sys/i386/include/pcb.h and /usr/src/sys/sys/user.h an empty struct md_coredump is defined. ANSI C does not allow empty structs.
>How-To-Repeat:
compile with gcc -pedantic:
#include        <unistd.h>
#include        <machine/pcb.h>

>Fix:
Put the struct inside a #if ! defined __STRICT_ANSI__:

--- /usr/src/sys/i386/include/pcb.h	Sun Sep  5 18:30:26 1999
+++ /usr/src/sys/i386/include/pcb.h	Sun Sep  5 18:31:00 1999
@@ -86,8 +86,10 @@
  * The pcb is augmented with machine-dependent additional data for
  * core dumps. For the i386: ???
  */
+#if ! defined(__STRICT_ANSI__)
 struct md_coredump {
 };
+#endif
 
 #ifdef _KERNEL
 
--- /usr/src/sys/sys/origuser.h	Thu Oct 11 12:05:10 2001
+++ /usr/src/sys/sys/user.h	Tue Nov 13 19:38:48 2001
@@ -106,7 +106,10 @@
 	 * Remaining fields for a.out core dumps - not valid at other times!
 	 */
 	struct	kinfo_proc u_kproc;	/* proc + eproc */
+
+#if !defined(__STRICT_ANSI__)		/* no empty structs please */
 	struct	md_coredump u_md;	/* machine dependent glop */
+#endif
 };
 
 #endif
>Release-Note:
>Audit-Trail:

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Marc Olzheim <marcolz@ilse.nl>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/33117: empty struct md_coredump in pcb.h and user.h violates strict ansi 
Date: Wed, 09 Jan 2002 16:19:43 +0200

 On Sun, 23 Dec 2001 20:17:56 +0100, Marc Olzheim wrote:
 
 > Put the struct inside a #if ! defined __STRICT_ANSI__:
 
 Won't an absent u_md break gcore(1)?  See src/usr.bin/gcore/md-sparc.c.
 
 Ciao,
 Sheldon.

From: Marc Olzheim <marcolz@ilse.nl>
To: Sheldon Hearn <sheldonh@starjuice.net>
Cc: Marc Olzheim <marcolz@ilse.nl>, FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/33117: empty struct md_coredump in pcb.h and user.h violates strict ansi
Date: Wed, 9 Jan 2002 15:22:21 +0100

 > Won't an absent u_md break gcore(1)?  See src/usr.bin/gcore/md-sparc.c.
 
 If it would be compiled with -ansi, it probably would, but gcore is not
 compiled with -ansi...
 
 Marc

From: Sheldon Hearn <sheldonh@starjuice.net>
To: bde@FreeBSD.org
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/33117: empty struct md_coredump in pcb.h and user.h violates strict ansi 
Date: Wed, 09 Jan 2002 16:52:23 +0200

 On Wed, 09 Jan 2002 15:22:21 +0100, Marc Olzheim wrote:
 
 > > Won't an absent u_md break gcore(1)?  See src/usr.bin/gcore/md-sparc.c.
 > 
 > If it would be compiled with -ansi, it probably would, but gcore is not
 > compiled with -ansi...
 
 Bruce, what say you with regards to the suggestion to exclude the u_md
 definition in user.h in the __STRICT_ANSI__ case?
 
 Ciao,
 Sheldon.

From: Bruce Evans <bde@zeta.org.au>
To: Sheldon Hearn <sheldonh@starjuice.net>
Cc: <bde@FreeBSD.org>, <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: kern/33117: empty struct md_coredump in pcb.h and user.h violates
 strict ansi 
Date: Thu, 10 Jan 2002 13:15:53 +1100 (EST)

 On Wed, 9 Jan 2002, Sheldon Hearn wrote:
 
 > On Wed, 09 Jan 2002 15:22:21 +0100, Marc Olzheim wrote:
 >
 > > > Won't an absent u_md break gcore(1)?  See src/usr.bin/gcore/md-sparc.c.
 > >
 > > If it would be compiled with -ansi, it probably would, but gcore is not
 > > compiled with -ansi...
 >
 > Bruce, what say you with regards to the suggestion to exclude the u_md
 > definition in user.h in the __STRICT_ANSI__ case?
 
 This would be wrong, especially on arches where u_md is nonempty because
 the kernel will supply user structs with u_md in them.
 
 The problem is moot in -current since u_md went away.  struct mdproc has
 also become nonempty on i386's, but there is now an empty struct mdthread
 to break compiling with -ansi at least in the kernel (-pedantic is also
 needed for breakage; -ansi alone works and this is tested a lot since the
 kernel is always compiled with it).
 
 Bruce
 

From: Marc Olzheim <marcolz@stack.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/33117: empty struct md_coredump in pcb.h and user.h violates strict ansi
Date: Wed, 16 Mar 2005 12:32:41 +0100

 This can be closed.
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Wed Mar 16 11:44:33 GMT 2005 
State-Changed-Why:  
struct md_coredump was killed more than two years ago: 

sys/sys/user.h rev. 1.51 
sys/i386/include/pcb.h rev. 1.48 

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