Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2001 20:17:56 +0100 (CET)
From:      Marc Olzheim <marcolz@ilse.nl>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/33117: empty struct md_coredump in pcb.h and user.h violates strict ansi
Message-ID:  <200112231917.fBNJHun02054@crime.ncc1701.org>

next in thread | raw e-mail | index | archive | help

>Number:         33117
>Category:       kern
>Synopsis:       empty struct md_coredump in pcb.h and user.h violates strict ansi
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 23 11:30:00 PST 2001
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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