unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Cc: guile-devel@gnu.org
Subject: Re: [Patch] inline.h should not define inline functions with "extern" linkage
Date: Sat, 21 Jun 2003 11:30:42 +1000	[thread overview]
Message-ID: <87el1ocj3x.fsf@zip.com.au> (raw)
In-Reply-To: <uw5y8zyw7pw.fsf@saturn.math.uni-magdeburg.de> (Matthias Koeppe's message of "Thu, 19 Jun 2003 14:51:55 +0200")

Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de> 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.

> 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)


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2003-06-21  1:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-19 12:51 [Patch] inline.h should not define inline functions with "extern" linkage Matthias Koeppe
2003-06-21  1:30 ` Kevin Ryde [this message]
2003-06-23  8:40   ` Matthias Koeppe
2003-09-12 14:13 ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87el1ocj3x.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).