Subject: Re: gsfr

From: [email-masked]
Date: Tue, 17 Nov 1998 16:59:51 +0100

On Tue, Nov 17, 1998 at 01:31:01PM +0000, [email-masked] wrote:
> And I strongly advise against macros like
> 
>     #define MyMacro()  stmt1; \
>                       stmt2; \
>                       stmt3;
> 
> These simply don't work like functions in all contexts. Use comma
> expressions, and ?: for conditions, and remember to cast to void any
> macro expression which is intended to act like a void function. And go
> no further...

Blargh, that's exactly what I'm talking about. Obscure macros with
lots of code doing intransparent things. It does not matter it you
use commas or not.

> That's simply a badly written macro. What's wrong with
> 
>     #define SETCHARPOINTER(c,p) (void)((p) = &(c))
 
That is not better in any way. You can STILL use ints without a
warning. The point is: you use the macro correctly at first, then
change the data type someday --> crash.

Bye

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].