wxFAIL usage

0 views
Skip to first unread message

Peter Most

unread,
Nov 7, 2009, 1:46:00 PM11/7/09
to wx-...@googlegroups.com
Hi everybody,

when I'm using wxFAIL(); in my code I'm getting an
"error: void value not ignored as it ought to be".
If I'm using it without the brackets e.g. wxFAIL; then I don't get that error.
Wouldn't it be more intuitive if the call with the brackets would be the
correct one?

Regards Peter

Vadim Zeitlin

unread,
Nov 7, 2009, 5:15:31 PM11/7/09
to wx-...@googlegroups.com
On Sat, 7 Nov 2009 19:46:00 +0100 Peter Most <Peter...@gmx.de> wrote:

PM> when I'm using wxFAIL(); in my code I'm getting an
PM> "error: void value not ignored as it ought to be".
PM> If I'm using it without the brackets e.g. wxFAIL; then I don't get that error.
PM> Wouldn't it be more intuitive if the call with the brackets would be the
PM> correct one?

Maybe but I believe it always worked like this (or did this change?) and
I'm not sure if the macro can be changed to work in both ways.

My recommendation is to always use wxFAIL_MSG() anyhow, I consider it an
error now to have wxFAIL at all. wxASSERT without message may make sense
sometimes if the condition is clear on its own but wxFAIL never does.

Regards,
VZ

Reply all
Reply to author
Forward
0 new messages