So I just found out about this great feature in gcc. I use it here to
much glory. Save code as evil.c, compile with gcc evil.c (No
optimisations!)
Here you will observe the power of gcc to much goodness, I'm sure you
will be impressed with my l33t codes.
>>>>>
#include <stdio.h>
int
main(int argc, char **argv)
{
void *x;
int i = 0;
if (argc % 2 == 0) {
x = &&foo;
} else {
x = &&bar;
}
printf("x is: %p\n", x);
if (x == &&bar && argc > 2) {
x += ((&&end_bar - &&bar) / 5) * argc;
}
printf("x is: %p\n", x);
goto *x;
foo:
printf("foo\n");
return 1;
bar:
i++;
i++;
i++;
i++;
i++;
end_bar:
printf("bar %d\n", i);
return 2;
}
<<<<<<<<
So, serious question, has anyone seen the unary && operator used in
real code? And if so, was it *really* needed?
Cheers,
Benno
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders