* LVM2/lib/misc util.h
@ 2010-10-26 10:04 zkabelac
2010-10-26 10:47 ` Alasdair G Kergon
0 siblings, 1 reply; 3+ messages in thread
From: zkabelac @ 2010-10-26 10:04 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2010-10-26 10:04:35
Modified files:
lib/misc : util.h
Log message:
Macro uninitialized_var gives warnings in static analysis
Deactivate uninitialized_var() macro for clang static analysis.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/util.h.diff?cvsroot=lvm2&r1=1.6&r2=1.7
--- LVM2/lib/misc/util.h 2010/05/24 23:11:35 1.6
+++ LVM2/lib/misc/util.h 2010/10/26 10:04:34 1.7
@@ -25,7 +25,11 @@
(void) (&_a == &_b); \
_a > _b ? _a : _b; })
+#ifdef __clang__
+#define uninitialized_var(x) x
+#else
#define uninitialized_var(x) x = x
+#endif
#define KERNEL_VERSION(major, minor, release) (((major) << 16) + ((minor) << 8) + (release))
^ permalink raw reply [flat|nested] 3+ messages in thread
* LVM2/lib/misc util.h
2010-10-26 10:04 zkabelac
@ 2010-10-26 10:47 ` Alasdair G Kergon
0 siblings, 0 replies; 3+ messages in thread
From: Alasdair G Kergon @ 2010-10-26 10:47 UTC (permalink / raw)
To: lvm-devel
On Tue, Oct 26, 2010 at 10:04:35AM -0000, zkabelac at sourceware.org wrote:
> +#ifdef __clang__
> +#define uninitialized_var(x) x
> +#else
> #define uninitialized_var(x) x = x
> +#endif
>
Please add a comment.
Alasdair
^ permalink raw reply [flat|nested] 3+ messages in thread
* LVM2/lib/misc util.h
@ 2011-04-08 14:11 zkabelac
0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-04-08 14:11 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-04-08 14:11:40
Modified files:
lib/misc : util.h
Log message:
Newer gcc doesn't need this trick
In fact it now generates an opposite warning about using undefined variable.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/util.h.diff?cvsroot=lvm2&r1=1.7&r2=1.8
--- LVM2/lib/misc/util.h 2010/10/26 10:04:34 1.7
+++ LVM2/lib/misc/util.h 2011/04/08 14:11:40 1.8
@@ -25,7 +25,7 @@
(void) (&_a == &_b); \
_a > _b ? _a : _b; })
-#ifdef __clang__
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
#define uninitialized_var(x) x
#else
#define uninitialized_var(x) x = x
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-08 14:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08 14:11 LVM2/lib/misc util.h zkabelac
-- strict thread matches above, loose matches on Subject: below --
2010-10-26 10:04 zkabelac
2010-10-26 10:47 ` Alasdair G Kergon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.