From patchwork Fri Dec 17 14:34:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 75903 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 E24CEB6ED0 for ; Sat, 18 Dec 2010 01:34:51 +1100 (EST) Received: (qmail 13033 invoked by alias); 17 Dec 2010 14:34:40 -0000 Received: (qmail 12832 invoked by uid 22791); 17 Dec 2010 14:34:39 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2beaomr06.btconnect.com (HELO mail.btconnect.com) (213.123.26.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Dec 2010 14:34:29 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2beaomr06.btconnect.com with ESMTP id BHV34047; Fri, 17 Dec 2010 14:34:22 +0000 (GMT) Cc: Paolo Bonzini , GCC Patches , Mike Stump Message-Id: <6C9F7F5D-9CCA-4978-B3DD-ECF2854CAAF7@sandoe-acoustics.co.uk> From: IainS To: "Joseph S. Myers" In-Reply-To: Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Patch, Darwin] Suppress build warnings about struct cl_decoded_option. Date: Fri, 17 Dec 2010 14:34:21 +0000 References: <4CD84427-D8DB-4992-8672-55F91A9FDD1E@sandoe-acoustics.co.uk> <4D0B418D.2090900@gnu.org> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0302.4D0B74E8.0154, actions=TAG X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0206.4D0B74F1.0044, ss=1, fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=single engine 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 On 17 Dec 2010, at 12:41, Joseph S. Myers wrote: > On Fri, 17 Dec 2010, Paolo Bonzini wrote: > >> On 12/17/2010 11:22 AM, IainS wrote: >>> Index: gcc/config/darwin.h >>> =================================================================== >>> --- gcc/config/darwin.h (revision 167881) >>> +++ gcc/config/darwin.h (working copy) >>> @@ -963,10 +968,10 @@ __enable_execute_stack (void *addr) >>> >>> #define TARGET_HAS_TARGETCM 1 >>> >>> -extern void darwin_driver_init (unsigned int >>> *decoded_options_count, >>> - struct cl_decoded_option **decoded_options); >> >> Can't you just add a "struct cl_decoded_option;" forward reference >> before the >> extern? > > The place for such forward references is in coretypes.h, not random > individual source files. And indeed such a declaration is already > there. > So if the warnings are from files not including coretypes.h, the > missing > coretypes.h includes should be added (after config.h and system.h, > before > any other headers are included). Or if the issue is that this > declaration > in coretypes.h is under "#ifndef USED_FOR_TARGET" and the warnings are > building code for the target, then the prototype in darwin.h should > also > be conditioned on "#ifndef USED_FOR_TARGET". the latter, thanks, Iain priorities. */ #undef SUPPORTS_INIT_PRIORITY Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 167976) +++ gcc/config/darwin.h (working copy) @@ -963,10 +968,11 @@ __enable_execute_stack (void *addr) #define TARGET_HAS_TARGETCM 1 -extern void darwin_driver_init (unsigned int *decoded_options_count, - struct cl_decoded_option **decoded_options); +#ifndef USED_FOR_TARGET +extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **); #define GCC_DRIVER_HOST_INITIALIZATION \ darwin_driver_init (&decoded_options_count, &decoded_options) +#endif /* The Apple assembler and linker do not support constructor