From: prj@po.cwru.edu (Paul Jarc)
Cc: guile-devel@gnu.org
Subject: Re: proposal: stricter type-checking for macros
Date: Wed, 31 Mar 2004 18:08:22 -0500 [thread overview]
Message-ID: <m3u104mx6r.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <m31xnhvtdj.fsf@multivac.cwru.edu> (Paul Jarc's message of "Thu, 25 Mar 2004 10:27:46 -0500")
I wrote:
> #define TYPECHECK(x) (0? (void)(*(SCM*)0=(x)): (void)0)
BTW, does anyone know of a similar trick for arrays? I can do this:
#define ARRAYCHECK(type, arr) \
(0? (void)(*(type (**)[sizeof (arr)/sizeof (type)])0=&(arr)): (void)0)
But this requires the caller to know not just the element type of the
array, but also whether the array is const. (Pointer to array of
const T is not compatible with pointer to array of non-const T.) I'd
like to find a way to check that the expression is an array of const
or non-const T, giving a warning iff it is neither. (That way,
ARRAYCHECK(char, "foo") would work with or without -Wwrite-strings.)
paul
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2004-03-31 23:08 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
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 [this message]
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=m3u104mx6r.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).