qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] clang warnings too noisy
@ 2015-03-06 19:06 Stefan Hajnoczi
  2015-03-06 23:47 ` Peter Maydell
  2015-03-07  9:04 ` Stefan Weil
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2015-03-06 19:06 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

Hi Peter,
You are rejecting pull requests that produce warnings under clang.

clang 3.5.0 on Fedora 21 produces so much noise that it's extremely
tedious and error-prone to try finding relevant new warnings.

Are you using a different clang version which produces fewer warnings?

Is anyone working on making QEMU build cleanly under clang?  Under gcc
people regularly submit patches to keep the build clean (e.g. recent
gcc 5 fixes).

Currently I'm not happy wrangling with clang when very few people seem
to use it or care enough to make QEMU build cleanly.

Examples of noise produced by clang:

1. It complains about glib headers:
In file included from /home/stefanha/qemu/include/net/eth.h:32:
In file included from /home/stefanha/qemu/include/qemu/iov.h:17:
In file included from /home/stefanha/qemu/include/qemu-common.h:43:
In file included from /home/stefanha/qemu/include/glib-compat.h:19:
In file included from /usr/include/glib-2.0/glib.h:50:
In file included from /usr/include/glib-2.0/glib/ghash.h:33:
In file included from /usr/include/glib-2.0/glib/glist.h:32:
/usr/include/glib-2.0/glib/gmem.h:76:78: warning: unknown attribute
'__alloc_size__' ignored [-Wunknown-attributes]
gpointer g_malloc (gsize n_bytes) __attribute__((__malloc__))
__attribute__((__alloc_size__(1)));
                                                                             ^
/usr/include/glib-2.0/glib/gmem.h:78:79: warning: unknown attribute
'__alloc_size__' ignored [-Wunknown-attributes]

2. It complains about the 'return !strcmp(s, "?") || !strcmp(s,
"help")' in qemu-common.h:
/home/stefanha/qemu/include/qemu-common.h:150:1916: warning: array
index 3 is past the end of the array (which contains 2 elements)
[-Warray-bounds]
    return !__extension__ ({ size_t __s1_len, __s2_len;
(__builtin_constant_p (s) && __builtin_constant_p ("?") && (__s1_len =
strlen (s), __s2_len = strlen ("?"), (!((size_t)(const void *)((s) +
1) - (size_t)(const void *)(s) == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)(("?") + 1) - (size_t)(const void *)("?") ==
1) || __s2_len >= 4)) ? __builtin_strcmp (s, "?") :
(__builtin_constant_p (s) && ((size_t)(const void *)((s) + 1) -
(size_t)(const void *)(s) == 1) && (__s1_len = strlen (s), __s1_len <
4) ? (__builtin_constant_p ("?") && ((size_t)(const void *)(("?") + 1)
- (size_t)(const void *)("?") == 1) ? __builtin_strcmp (s, "?") : ...

3. It complains about unused -I paths:
clang: warning: argument unused during compilation: '-I /home/stefanha/qemu/tcg'
clang: warning: argument unused during compilation: '-I
/home/stefanha/qemu/tcg/i386'
clang: warning: argument unused during compilation: '-I
/home/stefanha/qemu/linux-headers'

Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-10 10:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06 19:06 [Qemu-devel] clang warnings too noisy Stefan Hajnoczi
2015-03-06 23:47 ` Peter Maydell
2015-03-07 11:14   ` Paolo Bonzini
2015-03-07 11:29     ` Stefan Weil
2015-03-10 10:35   ` Stefan Hajnoczi
2015-03-07  9:04 ` Stefan Weil
2015-03-07  9:50   ` Stefan Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).