NetBSD Problem Report #46040
From www@NetBSD.org Fri Feb 17 15:43:13 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id 9F7ED63E05E
for <gnats-bugs@gnats.NetBSD.org>; Fri, 17 Feb 2012 15:43:13 +0000 (UTC)
Message-Id: <20120217154312.4A76D63DC65@www.NetBSD.org>
Date: Fri, 17 Feb 2012 15:43:12 +0000 (UTC)
From: henning.petersen@t-online.de
Reply-To: henning.petersen@t-online.de
To: gnats-bugs@NetBSD.org
Subject: Errors in spawn.h
X-Send-Pr-Version: www-1.0
>Number: 46040
>Category: misc
>Synopsis: Errors in spawn.h
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: misc-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 17 15:45:00 +0000 2012
>Closed-Date: Fri Apr 13 01:28:54 +0000 2012
>Last-Modified: Fri Apr 13 01:28:54 +0000 2012
>Originator: Henning Petersen
>Release: NetBSD-current
>Organization:
>Environment:
>Description:
Problems with spawn.h.
Missing __BEGIN_DECELS.
Error building tools llvm/Clang in [__restrict]
at line 43 and 46 in spawn.h.
Build with patch is working.
>How-To-Repeat:
>Fix:
diff -u -p -r1.1 spawn.h
--- include/spawn.h 11 Feb 2012 23:31:24 -0000 1.1
+++ include/spawn.h 17 Feb 2012 15:28:26 -0000
@@ -33,16 +33,17 @@
#include <sys/spawn.h>
+__BEGIN_DECLS
/*
* Spawn routines
*
*/
int posix_spawn(pid_t * __restrict, const char * __restrict,
const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict,
- char * const [__restrict], char * const [__restrict]);
+ char * const [/*__restrict*/], char * const [/*__restrict*/]);
int posix_spawnp(pid_t * __restrict, const char * __restrict,
const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict,
- char * const [__restrict], char * const [__restrict]);
+ char * const [/*__restrict*/], char * const [/*__restrict*/]);
/*
* File descriptor actions
>Release-Note:
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: misc/46040: Errors in spawn.h
Date: Fri, 17 Feb 2012 16:48:32 +0100
On Fri, Feb 17, 2012 at 03:45:00PM +0000, henning.petersen@t-online.de wrote:
> Missing __BEGIN_DECELS.
This part is clear.
> Error building tools llvm/Clang in [__restrict]
> at line 43 and 46 in spawn.h.
This part I don't understand.
Martin
From: henning petersen <henning.petersen@t-online.de>
To: gnats-bugs@NetBSD.org
Cc: Martin Husemann <martin@duskware.de>
Subject: Re: misc/46040: Errors in spawn.h
Date: Fri, 17 Feb 2012 17:51:59 +0100
Am 17.02.2012 16:50, schrieb Martin Husemann:
> The following reply was made to PR misc/46040; it has been noted by GNATS.
>
> From: Martin Husemann <martin@duskware.de>
> To: gnats-bugs@NetBSD.org
> Cc:
> Subject: Re: misc/46040: Errors in spawn.h
> Date: Fri, 17 Feb 2012 16:48:32 +0100
>
> On Fri, Feb 17, 2012 at 03:45:00PM +0000, henning.petersen@t-online.de wrote:
>
> > Missing __BEGIN_DECELS.
>
> This part is clear.
>
> > Error building tools llvm/Clang in [__restrict]
> > at line 43 and 46 in spawn.h.
>
> This part I don't understand.
>
> Martin
>
>
From FreeBSD spawn.h:
* XXX both arrays should be __restrict, but this does not work when GCC is invoked with -std=c99.
-
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: henning.petersen@t-online.de
Subject: Re: misc/46040: Errors in spawn.h
Date: Fri, 17 Feb 2012 18:02:39 +0100
On Fri, Feb 17, 2012 at 04:55:03PM +0000, henning petersen wrote:
> From FreeBSD spawn.h:
>
> * XXX both arrays should be __restrict, but this does not work when GCC is invoked with -std=c99.
Yes, I saw that, but I seems to not be true for our gcc. Note that cdefs.h
turns __restrict into restrict.
This compiles fine with "cc -Wall -O2 -std=c99 test.c" for me:
#include <string.h>
#include <spawn.h>
int main(int argc, char **argv)
{
posix_spawn(NULL, "/bin/ls", NULL, NULL, argv, NULL);
return 0;
}
What is the actual compile error you are seeing?
Martin
From: "Joerg Sonnenberger" <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46040 CVS commit: src/sys/sys
Date: Fri, 17 Feb 2012 18:58:51 +0000
Module Name: src
Committed By: joerg
Date: Fri Feb 17 18:58:51 UTC 2012
Modified Files:
src/sys/sys: cdefs.h
Log Message:
PR 46040:
If the current compiler doesn't support C99, check if it is compatible
with GCC 2.92. In that case, use the protected __restricted__ form.
In any other case, default to removing __restricted.
To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/sys/cdefs.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46040 CVS commit: [netbsd-6] src/sys/sys
Date: Wed, 22 Feb 2012 18:40:05 +0000
Module Name: src
Committed By: riz
Date: Wed Feb 22 18:40:05 UTC 2012
Modified Files:
src/sys/sys [netbsd-6]: cdefs.h
Log Message:
Pull up following revision(s) (requested by martin in ticket #16):
sys/sys/cdefs.h: revision 1.90
PR 46040:
If the current compiler doesn't support C99, check if it is compatible
with GCC 2.92. In that case, use the protected __restricted__ form.
In any other case, default to removing __restricted.
To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.6.1 src/sys/sys/cdefs.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 13 Apr 2012 01:28:54 +0000
State-Changed-Why:
Fixed, thanks.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.