On 16:40 Tue 10 Mar , Hal Rosenstock wrote:
> >
> > IOW no need to put { } braces around single expression.
>
> Compiler complains about ambiguous else without this.
I believe. This is because:
#define ERRS if (iberrs || ibdebug) IBWARN
So construction like:
if (cond)
ERRS("something");
else
...
, after preprocessor it becomes:
if (cond)
if (iberrs || ibdebug)
IBWARN("someting");
else
...
, and gcc complains about ambiguous else.
To avoid such sort of things I recommended in previous email to wrap
ERRS() macro with do {} while (0):
#define ERRS(fmt, ...) do { \
if (iberrs || ibdebug) \
IBWARN(fmt, ## __VA_ARGS__); \
} while (0)
Sasha
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general