Liste des Groupes | Revenir à cl c |
I have this macro:
>
#define WARN(...) \
do { \
fprintf(stderr, "%s#%d: ", __FILE__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
} while (0);
>
which I use like this:
>
total++;
if (failed) {
WARN("failed because...");
} else
ok++;
>
I would prefer to be able to write this instead:
>
total++;
if (failed)
WARN("failed because...");
else
ok++;
>
but doing so results in a compiler error:
>
error: 'else' without a previous 'if'
Les messages affichés proviennent d'usenet.