--- Marc Brünink <[EMAIL PROTECTED]> schrieb:
> Hi all,
>
> This Code does not work on Solaris 10 x86:
> #define MIN(a,b) \
> ({typeof(a) _MIN_a = (a); typeof(b) _MIN_b = (b); \
> _MIN_a < _MIN_b ? _MIN_a : _MIN_b; })
>
> But this one does:
> #define MIN(a,b) ( a < b ? a : b)
>
> So why the heck do we use all this typeof stuff?
>
Hello there,
I am no expert but the first version only evaluates its arguments once,
and hence it works correctly with expressions that have side effects. You
need the typeof to declare the temporary variables for the arguments a and
b.
Best regards,
Marko
+-------------------------------------------------------------+
| Marko Riedel, EDV Neue Arbeit gGmbH, [EMAIL PROTECTED] |
| http://www.geocities.com/markoriedelde/index.html |
+-------------------------------------------------------------+
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep