[systemd-commits] 3 commits - src/journal src/libsystemd

Daniel Mack zonque at kemper.freedesktop.org
Thu Feb 20 08:41:50 PST 2014


 src/journal/journal-file.c          |    2 +-
 src/journal/sd-journal.c            |    4 ++--
 src/libsystemd/sd-bus/bus-objects.c |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 748db5928c573fd699cd88f32fe21a456fa46d3e
Author: Daniel Mack <zonque at gmail.com>
Date:   Thu Feb 20 17:24:36 2014 +0100

    journal: fix compiler warning in journal_file_append_data()
    
    gcc (4.8.2, arm) does not understand that journal_file_append_field()
    will always set 'fo' when it returns 0, so this warning is bogus.
    
    Anyway, fix it by initialiting fo = NULL.

diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 3a08111..23c4d28 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1012,8 +1012,8 @@ static int journal_file_append_data(
         else
                 eq = memchr(data, '=', size);
         if (eq && eq > data) {
+                Object *fo = NULL;
                 uint64_t fp;
-                Object *fo;
 
                 /* Create field object ... */
                 r = journal_file_append_field(f, data, (uint8_t*) eq - (uint8_t*) data, &fo, &fp);

commit a002d44b008acd309987c37eb48009e3125a532c
Author: Daniel Mack <zonque at gmail.com>
Date:   Thu Feb 20 17:21:13 2014 +0100

    journal: fix compiler warning in real_journal_next()
    
    gcc (4.8.2, arm) does not understand that next_beyond_location() will
    always set 'p' when it returns > 0. Initialize p in order to fix this.

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 831ab6b..3740a9a 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -871,9 +871,9 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc
 static int real_journal_next(sd_journal *j, direction_t direction) {
         JournalFile *f, *new_file = NULL;
         uint64_t new_offset = 0;
-        Object *o;
-        uint64_t p;
+        uint64_t p = 0;
         Iterator i;
+        Object *o;
         int r;
 
         assert_return(j, -EINVAL);

commit c94d7fc3cefa16f6b715d469b7aa93c39c649b3c
Author: Daniel Mack <zonque at gmail.com>
Date:   Thu Feb 20 17:14:50 2014 +0100

    libsystemd: fix compiler warning in property_get_set_callbacks_run()
    
    gcc (4.8.2, arm) doesn't understand that vtable_property_get_userdata()
    will always set 'u' when it returns > 0. Hence, the warning is bogus,
    but anyway.
    
      src/libsystemd/sd-bus/bus-objects.c:510:19: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    (and yes, indeed, even the reported line numbers are bogus in this case)

diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 85800cb..7d325fa 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -527,7 +527,7 @@ static int property_get_set_callbacks_run(
 
         _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        void *u;
+        void *u = NULL;
         int r;
 
         assert(bus);



More information about the systemd-commits mailing list