From nobody@FreeBSD.ORG  Wed Sep 20 11:17:01 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 21CFD37B422; Wed, 20 Sep 2000 11:17:01 -0700 (PDT)
Message-Id: <20000920181701.21CFD37B422@hub.freebsd.org>
Date: Wed, 20 Sep 2000 11:17:01 -0700 (PDT)
From: earl_chew@agilent.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: g++ barfs on anonymous i386 sigjmp_buf structure
X-Send-Pr-Version: www-1.0

>Number:         21427
>Category:       i386
>Synopsis:       g++ barfs on anonymous i386 sigjmp_buf structure
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 20 11:20:00 PDT 2000
>Closed-Date:    Fri Oct 6 04:58:26 PDT 2000
>Last-Modified:  Fri Oct 27 02:30:01 PDT 2000
>Originator:     Earl Chew
>Release:        4.0-RELEASE
>Organization:
Agilent Technologies
>Environment:
FreeBSD bna2188.canada.agilent.com 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Mon Mar 2
0 22:50:22 GMT 2000     root@monster.cdrom.com:/usr/src/sys/compile/GENERIC  i38
6
>Description:
The definition in machine/setjmp.h for i386 is:

typedef struct { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1];

g++ complains when it cannot resolve the name of the structure.


>How-To-Repeat:
The following C++ program:

#include <setjmp.h>

sigjmp_buf& foo();

produces the following message:

foo.cc:3: non-local function `struct {anonymous} (& foo())[1]' uses anonymous ty
pe

>Fix:
typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
typedef struct _jmp_buf { int _jb[_JBLEN + 1]; } jmp_buf[1];


>Release-Note:
>Audit-Trail:

From: Earl Chew <earl_chew@agilent.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: i386/21427: g++ barfs on anonymous i386 sigjmp_buf structure
Date: Wed, 20 Sep 2000 11:28:16 -0700

 An additional problem with i386 machine/setjmp.h is that doesn't
 have #inclusion guards to prevent problems with multiple inclusions.
 
 Something like:
 
 #ifndef _MACHINE_SETJMP_H
 #define _MACHINE_SETJMP_H
 ...
 
 #endif
 
 Earl
 -- 
 >----------------------------------------------------------------------+
 > Earl Chew                              http://www.agilent.com        |
 > Agilent Technologies                   mailto:earl_chew@agilent.com  |
 > Advanced Networks Division             Tel:   +1 604 454 3411        |
 > 2500-4710 Kingsway                     Fax:   +1 604 454 3401        |
 > Burnaby BC V5H 4M2 Canada                                            |
 >----------------------------------------------------------------------+
 
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Fri Oct 6 04:58:26 PDT 2000 
State-Changed-Why:  
Equivalent to PR 16170.  Fixed in -current.  Will be fixed in 
RELENG_4 in a few days.  Doesn't affect RELENG_3. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21427 

From: Bruce Evans <bde@zeta.org.au>
To: Earl Chew <earl_chew@agilent.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: i386/21427: g++ barfs on anonymous i386 sigjmp_buf structure
Date: Fri, 6 Oct 2000 23:03:36 +1100 (EST)

 On Wed, 20 Sep 2000, Earl Chew wrote:
 
 >  An additional problem with i386 machine/setjmp.h is that doesn't
 >  have #inclusion guards to prevent problems with multiple inclusions.
 
 This can be considered as a feature.  <machine/setjmp.h> should only
 be included by <setjmp.h> and there is an inclusion in the latter.
 
 Bruce
 
 

From: Andy Newman <andy@silverbrook.com.au>
To: freebsd-gnats-submit@FreeBSD.org, earl_chew@agilent.com
Cc:  
Subject: Re: i386/21427: g++ barfs on anonymous i386 sigjmp_buf structure
Date: Thu, 19 Oct 2000 15:41:07 +1100

 I hit this today with 4.1-STABLE.  The last update to the PR was Oct.06
 (almost two weeks). Any ETA's on MFCs BDE? (TLA-itis!)
 --
 Andy Newman, Principal Software Engineer, Silverbrook Research
 

From: Bruce Evans <bde@zeta.org.au>
To: Andy Newman <andy@silverbrook.com.au>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: i386/21427: g++ barfs on anonymous i386 sigjmp_buf structure
Date: Fri, 27 Oct 2000 20:18:36 +1100 (EST)

 On Wed, 18 Oct 2000, Andy Newman wrote:
 
 >  I hit this today with 4.1-STABLE.  The last update to the PR was Oct.06
 >  (almost two weeks). Any ETA's on MFCs BDE? (TLA-itis!)
 
 Done.  So it should be fixed in 4.2.
 
 Bruce
 
 
>Unformatted:
