tmpfiles: use casts instead of warning suppression

This warning got its own name only in gcc5, so the suppression does
not work in gcc4, and generates a warning of its own. Use a cast,
which is ugly too, but less so.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-01-26 10:39:03 -05:00
parent 9cccac8cd2
commit ebf31a1f58

View file

@ -879,17 +879,13 @@ static int item_do_children(Item *i, const char *path, action_t action) {
} }
static int glob_item(Item *i, action_t action, bool recursive) { static int glob_item(Item *i, action_t action, bool recursive) {
DISABLE_WARNING_INCOMPATIBLE_POINTER_TYPES
DISABLE_WARNING_DECLARATION_AFTER_STATEMENT
_cleanup_globfree_ glob_t g = { _cleanup_globfree_ glob_t g = {
.gl_closedir = closedir, .gl_closedir = (void (*)(void *)) closedir,
.gl_readdir = readdir, .gl_readdir = (struct dirent *(*)(void *)) readdir,
.gl_opendir = opendir_nomod, .gl_opendir = (void *(*)(const char *)) opendir_nomod,
.gl_lstat = lstat, .gl_lstat = lstat,
.gl_stat = stat, .gl_stat = stat,
}; };
REENABLE_WARNING
REENABLE_WARNING
int r = 0, k; int r = 0, k;
char **fn; char **fn;