Re: [PATCH] Kbuild: Move -Wmaybe-uninitialized to W=1

From: Borislav Petkov
Date: Thu Jul 10 2014 - 06:42:38 EST


And,

I haven't even wished for it but just to prove everybody my point: just
built rc4+ from Linus' repo with gcc 4.9.0, see below.

Now all of a sudden there's more noise, maybe because this is a
different .config. However, I doubt those are real bugs.

A cursory look through those shows that they're not really bugs -
gcc simply can't know with all the ifdeffery, partial usage based on
conditionals, etc, etc.

---
In file included from scripts/sortextable.c:194:0:
scripts/sortextable.c: In function âmainâ:
scripts/sortextable.h:176:3: warning: ârelocs_sizeâ may be used uninitialized in this function [-Wmaybe-uninitialized]
memset(relocs, 0, relocs_size);
^
scripts/sortextable.h:106:6: note: ârelocs_sizeâ was declared here
int relocs_size;
^
In file included from scripts/sortextable.c:192:0:
scripts/sortextable.h:176:3: warning: ârelocs_sizeâ may be used uninitialized in this function [-Wmaybe-uninitialized]
memset(relocs, 0, relocs_size);
^
scripts/sortextable.h:106:6: note: ârelocs_sizeâ was declared here
int relocs_size;
^
fs/namespace.c: In function âSyS_mountâ:
fs/namespace.c:2647:8: warning: âkernel_devâ may be used uninitialized in this function [-Wmaybe-uninitialized]
ret = do_mount(kernel_dev, kernel_dir->name, kernel_type, flags,
^
fs/namespace.c:2626:8: note: âkernel_devâ was declared here
char *kernel_dev;
^
fs/namespace.c:2647:8: warning: âkernel_typeâ may be used uninitialized in this function [-Wmaybe-uninitialized]
ret = do_mount(kernel_dev, kernel_dir->name, kernel_type, flags,
^
fs/namespace.c:2624:8: note: âkernel_typeâ was declared here
char *kernel_type;
^
fs/direct-io.c: In function âdo_blockdev_direct_IOâ:
fs/direct-io.c:920:9: warning: âtoâ may be used uninitialized in this function [-Wmaybe-uninitialized]
while (from < to) {
^
fs/direct-io.c:913:16: note: âtoâ was declared here
size_t from, to;
^
fs/direct-io.c:1034:9: warning: âfromâ may be used uninitialized in this function [-Wmaybe-uninitialized]
from += this_chunk_bytes;
^
fs/direct-io.c:913:10: note: âfromâ was declared here
size_t from, to;
^
In file included from include/net/inetpeer.h:15:0,
from net/ipv4/tcp_metrics.c:16:
net/ipv4/tcp_metrics.c: In function âtcp_peer_is_provenâ:
include/net/ipv6.h:422:38: warning: â*((void *)&daddr+8)â may be used uninitialized in this function [-Wmaybe-uninitialized]
return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL;
^
net/ipv4/tcp_metrics.c:231:30: note: â*((void *)&daddr+8)â was declared here
struct inetpeer_addr saddr, daddr;
^
In file included from include/net/inetpeer.h:15:0,
from net/ipv4/tcp_metrics.c:16:
include/net/ipv6.h:422:38: warning: â*((void *)&saddr+8)â may be used uninitialized in this function [-Wmaybe-uninitialized]
return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL;
^
net/ipv4/tcp_metrics.c:231:23: note: â*((void *)&saddr+8)â was declared here
struct inetpeer_addr saddr, daddr;
^

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/