From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Merging =?utf-8?b?4oCYYmR3LWdjLXN0YXRpYy1hbGxvY+KAmQ==?= Date: Mon, 02 Nov 2009 22:44:19 +0100 Message-ID: <87hbtciouk.fsf@gnu.org> References: <8763ay88d6.fsf@gnu.org> <87vdi6sc5m.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1257198317 5330 80.91.229.12 (2 Nov 2009 21:45:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 21:45:17 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Nov 02 22:45:10 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N54hr-0004W1-Ru for guile-devel@m.gmane.org; Mon, 02 Nov 2009 22:44:56 +0100 Original-Received: from localhost ([127.0.0.1]:58378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N54hr-0006YM-Db for guile-devel@m.gmane.org; Mon, 02 Nov 2009 16:44:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N54ho-0006YH-SS for guile-devel@gnu.org; Mon, 02 Nov 2009 16:44:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N54hj-0006X9-Us for guile-devel@gnu.org; Mon, 02 Nov 2009 16:44:52 -0500 Original-Received: from [199.232.76.173] (port=41431 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N54hj-0006X4-Rw for guile-devel@gnu.org; Mon, 02 Nov 2009 16:44:47 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:43175) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N54hj-0005hR-Bt for guile-devel@gnu.org; Mon, 02 Nov 2009 16:44:47 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N54hf-0004MK-Gn for guile-devel@gnu.org; Mon, 02 Nov 2009 22:44:43 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 22:44:43 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 22:44:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 73 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 12 Brumaire an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu Cancel-Lock: sha1:wCfeXfjlwON8TeWeXCi7zPVfJ7g= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9625 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hello! I merged that branch in ‘master’. ... and soon after I noticed this glitch with ‘SCM_DEFINE’: when ‘SCM_SUPPORT_STATIC_ALLOCATION’ is defined, it requires a previous C declaration of the subr being defined. For instance: SCM_DEFINE (foo, "foo", 1, 0, 0, (SCM x), "") { ... } must now be preceded by: extern SCM foo (SCM); This is not a problem in Guile core where we compile with ‘-Wmissing-prototypes’ and provide public declarations for all ‘SCM_DEFINE’d functions, but it may be a problem in projects that don’t. This is easily remedied this way: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -101,14 +101,15 @@ SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING) /* Static subr allocation. */ #define SCM_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \ SCM_SYMBOL (scm_i_paste (FNAME, __name), PRIMNAME); \ -SCM_SNARF_HERE( \ +SCM_SNARF_HERE( \ static const char scm_i_paste (s_, FNAME) [] = PRIMNAME; \ + extern SCM FNAME ARGLIST; \ SCM_IMMUTABLE_SUBR (scm_i_paste (FNAME, __subr), \ scm_i_paste (FNAME, __name), \ REQ, OPT, VAR, &FNAME); \ SCM FNAME ARGLIST \ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit However, there are potentially 2 problems with this: 1. The declaration could conflict with a previous, slightly different one. Apparently, a given function declaration and the same one decorated with GCC function attributes are considered the same, so this should be OK. However, I’m slightly concerned about MSVC’s __declspec: does it work if it sees: __declspec(dllexport) extern SCM foo (SCM); extern SCM foo (SCM); If it works, that probably means this point is moot. 2. The automatically added ‘extern’ declaration makes ‘-Wmissing-prototypes’ useless, which is annoying. Thoughts? Thanks, Ludo’. --=-=-=--