libsemanage: 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:

      genhomedircon.c:742:67: error: empty expression statement has no
      effect; remove unnecessary ';' to silence this warning
      [-Werror,-Wextra-semi-stmt]
              const semanage_seuser_t **u2 = (const semanage_seuser_t **) arg2;;
                                                                               ^

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

View File

@ -740,7 +740,7 @@ static int write_user_context(genhomedircon_settings_t * s, FILE * out,
static int seuser_sort_func(const void *arg1, const void *arg2)
{
const semanage_seuser_t **u1 = (const semanage_seuser_t **) arg1;
const semanage_seuser_t **u2 = (const semanage_seuser_t **) arg2;;
const semanage_seuser_t **u2 = (const semanage_seuser_t **) arg2;
const char *name1 = semanage_seuser_get_name(*u1);
const char *name2 = semanage_seuser_get_name(*u2);

View File

@ -41,13 +41,17 @@
#include <stdlib.h>
#define DECLARE_SUITE(name) \
suite = CU_add_suite(#name, name##_test_init, name##_test_cleanup); \
if (NULL == suite) { \
CU_cleanup_registry(); \
return CU_get_error(); } \
if (name##_add_tests(suite)) { \
CU_cleanup_registry(); \
return CU_get_error(); }
do { \
suite = CU_add_suite(#name, name##_test_init, name##_test_cleanup); \
if (NULL == suite) { \
CU_cleanup_registry(); \
return CU_get_error(); \
} \
if (name##_add_tests(suite)) { \
CU_cleanup_registry(); \
return CU_get_error(); \
} \
} while (0)
static void usage(char *progname)
{