From patchwork Mon Jul 25 15:17:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 106701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 92F95B6FD1 for ; Tue, 26 Jul 2011 01:18:01 +1000 (EST) Received: (qmail 14296 invoked by alias); 25 Jul 2011 15:17:59 -0000 Received: (qmail 14286 invoked by uid 22791); 25 Jul 2011 15:17:59 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Jul 2011 15:17:45 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 57FD4A4D; Mon, 25 Jul 2011 17:17:44 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2EyI-mvZD6kw; Mon, 25 Jul 2011 17:17:42 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 9CDCBA4C; Mon, 25 Jul 2011 17:17:42 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id p6PFHgSk004848; Mon, 25 Jul 2011 17:17:42 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Bruce Korb Subject: [fixincludes] Fix posix_spawn* declarations in Solaris (PR c++/49347) Date: Mon, 25 Jul 2011 17:17:41 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org As discussed in the PR, the Solaris 10+ header needs a fix to make it work with g++. The following patch implements it. It passed a i386-pc-solaris2.11 bootstrap without regressions and make check in fixincludes works without failures. Ok for mainline? Thanks. Rainer diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -3706,6 +3706,23 @@ fix = { /* + * Solaris 10+ uses char *const argv[_RESTRICT_KYWD] in the + * posix_spawn declarations, which doesn't work with C++. + */ +fix = { + hackname = solaris_posix_spawn_restrict; + files = spawn.h; + mach = '*-*-solaris2*'; + c_fix = format; + c_fix_arg = "%1*_RESTRICT_KYWD %2%3"; + select = "(.*[ \t]+)([a-z]+)\\[_RESTRICT_KYWD\\](.*)"; + test_text = + "char *const argv[_RESTRICT_KYWD],\n" + "char *const envp[_RESTRICT_KYWD]);"; +}; + + +/* * Sun Solaris 8 has what appears to be some gross workaround for * some old version of their c++ compiler. G++ doesn't want it * either, but doesn't want to be tied to SunPRO version numbers. diff --git a/fixincludes/tests/base/spawn.h b/fixincludes/tests/base/spawn.h new file mode 100644 --- /dev/null +++ b/fixincludes/tests/base/spawn.h @@ -0,0 +1,15 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/spawn.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( SOLARIS_POSIX_SPAWN_RESTRICT_CHECK ) +char *const *_RESTRICT_KYWD argv, +char *const *_RESTRICT_KYWD envp); +#endif /* SOLARIS_POSIX_SPAWN_RESTRICT_CHECK */