|
From: | Paul Jarc |
Subject: | Re: proposal: stricter type-checking for macros |
Date: | Thu, 25 Mar 2004 10:27:46 -0500 |
User-agent: | Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
Han-Wen Nienhuys <address@hidden> 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
[Prev in Thread] | Current Thread | [Next in Thread] |