On Mon, May 19, 2014 at 07:52:20PM +0200, Tom Gundersen wrote: > On Sun, May 18, 2014 at 10:30 PM, Cristian Rodríguez > <crrodrig...@opensuse.org> wrote: > > --- > > src/journal/test-journal-stream.c | 2 +- > > src/libsystemd/sd-login/sd-login.c | 2 +- > > src/shared/util.c | 4 ++-- > > 3 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/src/journal/test-journal-stream.c > > b/src/journal/test-journal-stream.c > > index 8e1d08d..4f56edb 100644 > > --- a/src/journal/test-journal-stream.c > > +++ b/src/journal/test-journal-stream.c > > @@ -41,7 +41,7 @@ static void verify_contents(sd_journal *j, unsigned skip) > > { > > const void *d; > > char *k, *c; > > size_t l; > > - unsigned u; > > + unsigned u = 0; > > > > assert_se(sd_journal_get_cursor(j, &k) >= 0); > > printf("cursor: %s\n", k); > > diff --git a/src/libsystemd/sd-login/sd-login.c > > b/src/libsystemd/sd-login/sd-login.c > > index e7eea19..583095d 100644 > > --- a/src/libsystemd/sd-login/sd-login.c > > +++ b/src/libsystemd/sd-login/sd-login.c > > @@ -82,7 +82,7 @@ _public_ int sd_pid_get_owner_uid(pid_t pid, uid_t *uid) { > > } > > > > _public_ int sd_peer_get_session(int fd, char **session) { > > - struct ucred ucred; > > + struct ucred ucred = {}; > > I can't reproduce this warning, but more importantly, why is this > necessary in this function and not the subsequent noes (which all seem > to be more or less equivalent)? I guess this is reported by gcc -Wmaybe-uninitialized
I've experienced these false positive warnings, with different gcc versions! the -Wmaybe-uninitialized is affected by the optimization flags and lto, I would say the warnings depend on the code path and how it's optimized... -- Djalal Harouni http://opendz.org _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel