Bug 33117

Summary: [patch] empty struct md_coredump in pcb.h and user.h violates strict ansi
Product: Base System Reporter: marcolz <marcolz>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-PRERELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description marcolz 2001-12-23 19:30:00 UTC
	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.

Fix: Put the struct inside a #if ! defined __STRICT_ANSI__:
How-To-Repeat: compile with gcc -pedantic:
#include        <unistd.h>
#include        <machine/pcb.h>
Comment 1 Sheldon Hearn 2002-01-09 14:19:43 UTC
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.
Comment 2 marcolz 2002-01-09 14:22:21 UTC
> 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
Comment 3 Sheldon Hearn 2002-01-09 14:52:23 UTC
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.
Comment 4 Bruce Evans 2002-01-10 02:15:53 UTC
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
Comment 5 Marc Olzheim 2005-03-16 11:32:41 UTC
This can be closed.
Comment 6 Maxim Konovalov freebsd_committer freebsd_triage 2005-03-16 11:44:33 UTC
State Changed
From-To: open->closed

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