unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Cc: guile-devel@gnu.org
Subject: Re: proposal: stricter type-checking for macros
Date: Thu, 25 Mar 2004 10:27:46 -0500	[thread overview]
Message-ID: <m31xnhvtdj.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <16482.53029.540065.796985@localhost.localdomain> (Han-Wen Nienhuys's message of "Thu, 25 Mar 2004 13:23:01 +0100")

Han-Wen Nienhuys  <hanwen@xs4all.nl> wrote:
> // #define TYPECHECK(x)  (global_object = (x))

#define TYPECHECK(x) (0? (void)(*(SCM*)0=(x)): (void)0)

Casting to void ensures that the resulting "value" won't accidentally
be used for anything.  "0?" ensures that the null pointer won't
actually be dereferenced.  I'd expect dead-code elimination to compile
this into nothing, but I haven't checked which optimization level this
happens for.


paul


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


  reply	other threads:[~2004-03-25 15:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-25 12:23 proposal: stricter type-checking for macros Han-Wen Nienhuys
2004-03-25 15:27 ` Paul Jarc [this message]
2004-03-25 15:34   ` Han-Wen Nienhuys
2004-04-24 22:09     ` Marius Vollmer
2004-04-24 22:54       ` Han-Wen Nienhuys
2004-04-24 23:42         ` Marius Vollmer
2004-03-31 23:08   ` Paul Jarc

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=m31xnhvtdj.fsf@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    --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).