From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17793 invoked by alias); 8 Aug 2011 19:40:51 -0000 Received: (qmail 17780 invoked by uid 22791); 8 Aug 2011 19:40:50 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 19:40:37 +0000 Received: by wyf19 with SMTP id 19so327582wyf.20 for ; Mon, 08 Aug 2011 12:40:35 -0700 (PDT) Received: by 10.227.2.72 with SMTP id 8mr4791890wbi.99.1312832435541; Mon, 08 Aug 2011 12:40:35 -0700 (PDT) Received: from [192.168.1.2] (143.176.115.78.rev.sfr.net [78.115.176.143]) by mx.google.com with ESMTPS id em16sm4745556wbb.33.2011.08.08.12.40.33 (version=SSLv3 cipher=OTHER); Mon, 08 Aug 2011 12:40:33 -0700 (PDT) Subject: Re: PATCH RFA: Build stages 2 and 3 with C++ Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=iso-8859-1 From: Romain Geissler In-Reply-To: Date: Mon, 08 Aug 2011 19:40:00 -0000 Cc: gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org Content-Transfer-Encoding: quoted-printable Message-Id: <6FFACDBB-EF0C-41F2-A8E4-F4C624EB9B32@gmail.com> References: <275E76F7-69B1-408C-9DC6-2C08BDBB5036@gmail.com> To: Ian Lance Taylor X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00175.txt.bz2 Le 8 ao=FBt 2011 =E0 20:49, Ian Lance Taylor a =E9crit : >=20 > However, since we currently permit plugins to call anything in gcc, I > think the answer is going to have to be that plugins which do that > should be compiled with C++. Ok, i'll move to C++ then, until a dedicated C plugin API comes out. > I don't think that adding extern "C" to > all gcc header files is the right approach. Adding extern "C" to a few > selected header files seems fine. Adding extern "C" to a small set of files doesn't make sense to me. When working with real-world plugin, you will certainly end up calling many different gcc primitives coming from a wide bunch of header files (which for most of them don't use extern "C" for now). This hack should be applied to all of the plugin visible files, or none, but not to just a few when som= eone needs it.