]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: use the same comment for work-around initializations
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Apr 2021 12:22:30 +0000 (14:22 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Apr 2021 14:04:22 +0000 (16:04 +0200)
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.

src/basic/cgroup-util.c
src/basic/copy.c
src/core/main.c
src/test/test-capability.c

index 8d3e5237a8cb9675911c8c7ef48770bbac8de1ee..fb68d286f0ad88a9aba4969b84c646697ebdc3f0 100644 (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) {
         _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;
 
         assert(pid >= 0);
index d25777cc4b47a030b03014ab1b55aea20d323a43..af9ac842a1150250f4f046b1e2d28e3043cbdb48 100644 (file)
@@ -1072,7 +1072,7 @@ int copy_file_full(
 
         _cleanup_close_ int fdf = -1;
         struct stat st;
-        int fdt = -1, r;
+        int r, fdt = -1;  /* avoid false maybe-uninitialized warning */
 
         assert(from);
         assert(to);
index 74dd895c588af3a06880dec39ec9c61e204f0542..63254b4a9c83e7213932bd50b856338a6bbb4ec1 100644 (file)
@@ -1367,7 +1367,7 @@ static int status_welcome(void) {
 
 static int write_container_id(void) {
         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");
         if (isempty(c))
index bd17dc0e790bf4c98a8d676e93556b396eddf201..5fa8fe242ef4ee11f2cd8a6641dbcad65c7d3451 100644 (file)
@@ -242,7 +242,7 @@ static void test_ensure_cap_64bit(void) {
 }
 
 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);