"Zack Weinberg" <zack at codesourcery.com> writes: > It does, however, lead to a different problem: > > if (condition) > Py_DECREF (foo); > else // oops, syntax error here How so? This expands to if(condition) if(cond2)action1; else action2; else ... This is perfectly well-formed C, and it groups as my indentation suggests. There is no real problem with this macro. It is just gcc complaining falsely. > In general I consider it appropriate to wrap _all_ macros that don't > return a value in do { ... } while (0), because that way you don't > have to worry about which of them truly need it. Hmm. Yes, this could be done - but it is unfortunate that this needs to be done only to silence gcc. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4