|
From: Ethan M. <merritt@u.washington.edu> - 2013-06-24 04:28:09
|
On Saturday, June 22, 2013 11:44:36 PM Mojca Miklavec wrote:
> On Sat, Jun 22, 2013 at 11:00 PM, Mojca Miklavec wrote:
> > Hi,
> >
> > just to let you know: the compiler (I just updated to a newer version
> > of Xcode) started complaining about "missing braces":
> >
> > wxterminal/wxt_gui.cpp:1500:4: warning: add explicit braces to avoid
> > dangling else [-Wdangling-else]
> >
> > wxLogError(wxT("Cannot write raise"));
> > ^
>
> I'm sorry, I've sent an incomplete error report earlier (because I
> thought at first that the other errors were unrelated). The problem is
> that wxLogError is a macro itself which expands into some if-else
> clauses and one indeed ends up with "if ... if ... else", so maybe the
> compiler is right after all. I'm attaching the patch. If you apply it,
> please also patch the stable branch.
>
> wxterminal/wxt_gui.cpp:1500:4: warning: add explicit braces to avoid
> dangling else [-Wdangling-else]
> wxLogError(wxT("Cannot write raise"));
> ^
> /opt/local/include/wx-2.9/wx/log.h:1360:20: note: expanded from macro
> 'wxLogError'
> #define wxLogError wxDO_LOG_IF_ENABLED(Error)
> ^
> /opt/local/include/wx-2.9/wx/log.h:1353:5: note: expanded from macro
> 'wxDO_LOG_IF_ENABLED'
> else
> \ ^
> wxterminal/wxt_gui.cpp:1502:4: warning: add explicit braces to avoid
> dangling else [-Wdangling-else]
> wxLogError(wxT("Cannot write persist"));
> ^
> /opt/local/include/wx-2.9/wx/log.h:1360:20: note: expanded from macro
> 'wxLogError'
> #define wxLogError wxDO_LOG_IF_ENABLED(Error)
> ^
> /opt/local/include/wx-2.9/wx/log.h:1353:5: note: expanded from macro
> 'wxDO_LOG_IF_ENABLED'
> else
> \ ^
>
> (Of course it wouldn't hurt if wxWidgets would put a pair of braces
> into their source code where wxDO_LOG_IF_ENABLED is defined, but
> that's another story.)
On wxt2.8 as installed here, wxLogError() is a function provided by a
library. It is not a macro. So the message you show makes no sense to me.
The on-line docs also list it as a function, so far as I tell tell.
Ethan
>
> Thank you,
> Mojca
|