From nobody@FreeBSD.org  Tue Oct 22 04:07:01 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A24DE37B401
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Oct 2002 04:07:01 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5EE4943E65
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Oct 2002 04:07:01 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9MB707R041403
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Oct 2002 04:07:00 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.6/8.12.6/Submit) id g9MB70UZ041402;
	Tue, 22 Oct 2002 04:07:00 -0700 (PDT)
Message-Id: <200210221107.g9MB70UZ041402@www.freebsd.org>
Date: Tue, 22 Oct 2002 04:07:00 -0700 (PDT)
From: "Ralf S. Engelschall" <rse@engelschall.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: multiple declaration of __mbstate_t (sys/_types.h & machine/ansi.h) breaks gcc 3.2 building
X-Send-Pr-Version: www-1.0

>Number:         44377
>Category:       misc
>Synopsis:       multiple declaration of __mbstate_t (sys/_types.h & machine/ansi.h) breaks gcc 3.2 building
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 22 04:10:01 PDT 2002
>Closed-Date:    Sun Nov 17 07:39:55 PST 2002
>Last-Modified:  Sun Nov 17 07:39:55 PST 2002
>Originator:     Ralf S. Engelschall
>Release:        FreeBSD 5.0-CURRENT
>Organization:
Cable & Wireless
>Environment:
FreeBSD dv2.dev.de.cw.net 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Oct 10 17:08:22 CEST 2002     root@dv2.dev.de.cw.net:/usr/src/sys/i386/compile/DV2  i386

>Description:
While building gcc 3.2 (for OpenPKG) I got:

In file included from include/stdio.h:58,
                 from ../../gcc/tsystem.h:63,
                 from ../../gcc/crtstuff.c:62:
/usr/include/sys/_types.h:83: conflicting types for `__mbstate_t'
/usr/include/machine/ansi.h:174: previous declaration of `__mbstate_t'
make[2]: *** [crtbegin.o] Error 1
make[1]: *** [stage1_build] Error 2

After #if 0...#endif in sys/_types.h for __mbstate_t the building
works fine again. I don't know which declaration is the correct one.
But at least the current situation breaks things.

>How-To-Repeat:
Rebuild gcc 3.2 or at least try to include both headers.

>Fix:
      
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mike 
State-Changed-When: Sun Nov 17 07:32:06 PST 2002 
State-Changed-Why:  

machine/ansi.h is a stale header; it was deleted from cvs when 
sys/_types.h was added.  Unfortunately there's no standard system to 
delete stale headers with installworld. 

GCC 3.2 and earlier need hacks to cope with hacks about knowing FreeBSD 
implementation details.  You can apply rev 1.16 gcc/gcc/ginclude/stddef.h 
(GCC CVS) to older versions of GCC or do something like rev 1.4 of 
ports/lang/gcc32/files/patch-va (FreeBSD CVS). 

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