1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

tree-wide: use the same comment for work-around initializations

This should make it easier to remove those warnings when the compiler
gets smarter. Not sure if I got them all...

Double space before the comment start to make it easier to separate from the
preceding line.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-04-07 14:22:30 +02:00
parent 462035d599
commit 7756528e9b
4 changed files with 4 additions and 4 deletions

View File

@ -660,7 +660,7 @@ int cg_remove_xattr(const char *controller, const char *path, const char *name)
int cg_pid_get_path(const char *controller, pid_t pid, char **ret_path) { int cg_pid_get_path(const char *controller, pid_t pid, char **ret_path) {
_cleanup_fclose_ FILE *f = NULL; _cleanup_fclose_ FILE *f = NULL;
const char *fs, *controller_str = NULL; /* silence gcc warning about unitialized variable */ const char *fs, *controller_str = NULL; /* avoid false maybe-uninitialized warning */
int unified, r; int unified, r;
assert(pid >= 0); assert(pid >= 0);

View File

@ -1072,7 +1072,7 @@ int copy_file_full(
_cleanup_close_ int fdf = -1; _cleanup_close_ int fdf = -1;
struct stat st; struct stat st;
int fdt = -1, r; int r, fdt = -1; /* avoid false maybe-uninitialized warning */
assert(from); assert(from);
assert(to); assert(to);

View File

@ -1367,7 +1367,7 @@ static int status_welcome(void) {
static int write_container_id(void) { static int write_container_id(void) {
const char *c; const char *c;
int r = 0; /* silence gcc warning about r being unitialized below */ int r = 0; /* avoid false maybe-uninitialized warning */
c = getenv("container"); c = getenv("container");
if (isempty(c)) if (isempty(c))

View File

@ -242,7 +242,7 @@ static void test_ensure_cap_64bit(void) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
bool run_ambient = false; /* unnecessary initialization to silence gcc warning */ bool run_ambient = false; /* avoid false maybe-uninitialized warning */
test_setup_logging(LOG_INFO); test_setup_logging(LOG_INFO);