From fjoe@lark.websci.ru  Tue Jan 18 01:02:45 2000
Return-Path: <fjoe@lark.websci.ru>
Received: from lark.websci.ru (olga.websci.ru [212.164.55.71])
	by hub.freebsd.org (Postfix) with ESMTP id 94DD5152A7
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 18 Jan 2000 01:02:37 -0800 (PST)
	(envelope-from fjoe@lark.websci.ru)
Received: (from fjoe@localhost)
	by lark.websci.ru (8.9.3/8.9.3) id PAA67829;
	Tue, 18 Jan 2000 15:02:22 +0600 (NOVT)
	(envelope-from fjoe)
Message-Id: <200001180902.PAA67829@lark.websci.ru>
Date: Tue, 18 Jan 2000 15:02:22 +0600 (NOVT)
From: Max Khon <fjoe@lark.websci.ru>
Reply-To: fjoe@lark.websci.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: compiling machine/setjmp.h with g++
X-Send-Pr-Version: 3.2

>Number:         16170
>Category:       kern
>Synopsis:       compiling machine/setjmp.h with g++
>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 Jan 18 01:10:01 PST 2000
>Closed-Date:    Fri Oct 27 02:20:12 PDT 2000
>Last-Modified:  Fri Oct 27 02:24:28 PDT 2000
>Originator:     Max Khon
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
WebSci Technologies Inc.
>Environment:

lark:~$uname -a
FreeBSD lark.websci.ru 4.0-CURRENT FreeBSD 4.0-CURRENT #4: Fri Jan 14 10:26:27 NOVT 2000     fjoe@lark.websci.ru:/usr/src/sys/compile/lark  i386
lark:~$g++ -v
Using builtin specs.
gcc version 2.95.2 19991024 (release)
lark:~$

>Description:

	C++ does not like tagless symbols

>How-To-Repeat:

sample program:
--- cut here ---
#include <setjmp.h>

int
foo(jmp_buf *j)
{
}
--- cut here ---

lark:~$g++ -c foo.cc
foo.cc:4: non-local function `int foo({anonymous struct} (*)[1])' uses anonymous type
lark:~$

>Fix:

*** setjmp.h.orig	Tue Jan 18 14:52:29 2000
--- setjmp.h	Tue Jan 18 14:51:53 2000
***************
*** 40,46 ****
   * internally to avoid some run-time errors for mismatches.
   */
  #ifndef _ANSI_SOURCE
! typedef struct { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
  #endif /* not ANSI */
  
! typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1];
--- 40,46 ----
   * internally to avoid some run-time errors for mismatches.
   */
  #ifndef _ANSI_SOURCE
! typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1];
  #endif /* not ANSI */
  
! typedef struct _jmp_buf { int _jb[_JBLEN + 1]; } jmp_buf[1];

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Fri Oct 27 02:20:12 PDT 2000 
State-Changed-Why:  
Suggested patch applied in -current and RELENG_4 (just before 4.2-RELEASE). 
Problem doesn't affect RELENG_3 (with non-ports gcc). 

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