From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthias Koeppe Newsgroups: gmane.lisp.guile.devel Subject: Re: [Patch] inline.h should not define inline functions with "extern" linkage Date: Mon, 23 Jun 2003 10:40:40 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87el1ocj3x.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1056357738 16375 80.91.224.249 (23 Jun 2003 08:42:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 23 Jun 2003 08:42:18 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 23 10:42:16 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19UMu0-0004Fy-00 for ; Mon, 23 Jun 2003 10:42:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19UMtO-0003Rk-GO for guile-devel@m.gmane.org; Mon, 23 Jun 2003 04:41:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19UMt5-0003I2-LL for guile-devel@gnu.org; Mon, 23 Jun 2003 04:41:19 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19UMsz-0003BN-Hx for guile-devel@gnu.org; Mon, 23 Jun 2003 04:41:14 -0400 Original-Received: from merkur.math.uni-magdeburg.de ([141.44.75.40]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19UMsW-0002uZ-Pf for guile-devel@gnu.org; Mon, 23 Jun 2003 04:40:44 -0400 Original-Received: from beta ([141.44.75.78] helo=beta.math.uni-magdeburg.de) by merkur.math.uni-magdeburg.de with esmtp (Exim 4.10) id 19UMsT-0005XY-00 for guile-devel@gnu.org; Mon, 23 Jun 2003 10:40:41 +0200 Original-Received: (from mkoeppe@localhost) by beta.math.uni-magdeburg.de (8.11.7+Sun/8.11.7) id h5N8eeH20736; Mon, 23 Jun 2003 10:40:40 +0200 (MEST) X-Authentication-Warning: beta.math.uni-magdeburg.de: mkoeppe set sender to mkoeppe@mail.math.uni-magdeburg.de using -f Original-To: guile-devel@gnu.org In-Reply-To: <87el1ocj3x.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 21 Jun 2003 11:30:42 +1000") Original-Lines: 46 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.3.50 (sparc-sun-solaris2.8) X-Warning: no 'abuse'-account in domain mail.math.uni-magdeburg.de (cf. RFC2142/4.) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2572 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2572 Kevin Ryde writes: > Matthias Koeppe writes: >> >> The "inline" keyword does not imply static linkage, and in fact >> inline.h defines the functions `scm_cell' and `scm_double_cell' >> explicitly with "extern" linkage. > > "extern inline" is a gcc-ism, as far as I'm aware. We use it in > gmp.h, but only with gcc. Yes. >> The patch below fixes it. inline.c defines the functions with >> external linkage, and every file including inline.h defines static >> inline copies. > > One possibility would be to do these things as macros, so as to avoid > depending on the compiler having an inline, or whether it only > actually inlines at certain optimization levels. > > You can imagine the sort of thing, setting a variable given to the > macro, rather than a return value, > > #define SCM_I_MKBIG(big) > do { > SCM __scm_i_mkbig__temp = scm_double_cell (scm_tc16_big, 0, 0, 0); > mpz_init (SCM_I_BIG_MPZ (__scm_i_mkbig__temp)); > (big) = __scm_i_mkbig__temp; > } while (0) CVS Guile uses a different method to deal with possibly inlined functions. inline.c defines ("extern", non-"inline") versions for use in user programs. If the C compiler recognizes an "inline" keyword, inline.h defines "inline" versions of the functions. However, there the gcc-ism of "extern inline" was used. My patch gets rid of this gcc-ism. This makes the compilation work with the Sun Forte compiler. I have adapted this approach to the inline functions in numbers.c. -- Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel