mcstrans: silence -Wextra-semi-stmt warning

On Ubuntu 20.04, when building with clang -Werror -Wextra-semi-stmt
(which is not the default build configuration), the compiler reports:

      mcstransd.c:72:35: error: empty expression statement has no effect;
      remove unnecessary ';' to silence this warning
      [-Werror,-Wextra-semi-stmt]
              log_debug("%s\n", "cleanup_exit");
                                               ^

Replace the empty log_debug substitution with a do { ... } while (0)
construction to silence this warning.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2021-07-03 16:31:22 +02:00 committed by James Carter
parent e45bc87094
commit e293718f0e
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@
#ifdef DEBUG
#define log_debug(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
#else
#define log_debug(fmt, ...) ;
#define log_debug(fmt, ...) do {} while (0)
#endif
static unsigned int maxbit=0;

View File

@ -40,7 +40,7 @@
//#define log_debug(fmt, ...) syslog(LOG_DEBUG, fmt, __VA_ARGS__)
#define log_debug(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
#else
#define log_debug(fmt, ...) ;
#define log_debug(fmt, ...) do {} while (0)
#endif
extern int init_translations(void);