@@ -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);
@@ -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)
{
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> --- libsemanage/src/genhomedircon.c | 2 +- libsemanage/tests/libsemanage-tests.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-)