unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: Re: How do I determine the argument type...
Date: Mon, 19 May 2003 10:47:43 +1000	[thread overview]
Message-ID: <87addjwymo.fsf@zip.com.au> (raw)
In-Reply-To: <3EC82689.6A652B72@veritas.com> (Bruce Korb's message of "Sun, 18 May 2003 17:34:17 -0700")

Bruce Korb <bkorb@veritas.com> writes:
>
> A macro cannot hide the problem.  You cannot set it back to int without
> breaking everyone who adapted to size_t.

I was thinking of something like,

#define gh_scm2newstr(str,lenp) \
  gh_scm2newstr_helper (str, lenp, sizeof (*lenp))

Not sure if all compilers will enjoy "sizeof(*NULL)" though.

Another way would be the following, though it unfortunately evaluates
the parameters more than once.  In gcc that could be avoided,
probably.

#define gh_scm2newstr(str,lenp) \
  ((lenp) ? *(lenp) = gh_scmstrlen (str) : 0,  \
   gh_scm2newstr_helper (str))

> "Oops.

I guess insofar as it's contrary to the docs it's an oops.

> use this configury macro to specify the type passed to
> gh_scm2newstr()."

Probably as simple as an AC_TRY_COMPILE (or AC_COMPILE_IFELSE, or
whatever it's called these days).


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


  reply	other threads:[~2003-05-19  0:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-10  3:27 How do I determine the argument type Bruce Korb
2003-05-10  3:31 ` Bruce Korb
2003-05-17 20:14 ` Marius Vollmer
2003-05-17 21:16   ` Bruce Korb
2003-05-18  1:57     ` Marius Vollmer
2003-05-18  2:59       ` Bruce Korb
2003-05-19  0:07       ` Kevin Ryde
2003-05-19  0:34         ` Bruce Korb
2003-05-19  0:47           ` Kevin Ryde [this message]
2003-05-19  1:44             ` Bruce Korb
2003-06-01 18:45         ` Marius Vollmer
2003-06-01 20:07           ` Bruce Korb
2003-06-11 22:33           ` Kevin Ryde

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=87addjwymo.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /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).