Evil preprocessor hack of the day [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Wed 2007-04-18 17:39
Evil preprocessor hack of the day
LinkReply
[identity profile] mooism.livejournal.comThu 2007-04-19 08:36
We want
if (foo)  handle_foo();
else if (bar)  handle_bar();
else since (baz)  handle_baz();
else since (quuz)  handle_quux();
to give a compile error.
Link Reply to this | Parent | Thread
[identity profile] mooism.livejournal.comThu 2007-04-19 08:38
Better example if the second since is an if.
Link Reply to this | Parent | Thread
[identity profile] womble2.livejournal.comThu 2007-04-19 22:29
gcc -Wunreachable-code -Werror
Link Reply to this | Parent | Thread
[identity profile] ewx.livejournal.comFri 2007-04-20 12:45
Or perhaps: #define since(x) if(assert(x),0);else (though I've not thought about this very hard yet).
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]