[Olsr-dev] [PATCH v1 05/12] Makefile: WARNINGS: add -Winit-self

Ferry Huberts (spam-protected)
Tue May 29 15:59:34 CEST 2012


From: Ferry Huberts <(spam-protected)>

-Winit-self (C, C++, Objective-C and Objective-C++ only)
   Warn about uninitialized variables which are initialized
   with themselves.  Note this option can only be used with
   the -Wuninitialized option.

   For example, GCC will warn about "i" being uninitialized
   in the following snippet only when -Winit-self has been
   specified:

           int f()
           {
             int i = i;
             return i;
           }

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 Makefile.inc |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index dc54539..541e9fb 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -92,6 +92,7 @@ WARNINGS +=	-Wcast-align
 WARNINGS +=	-Wdouble-promotion
 WARNINGS +=	-Wformat-security
 WARNINGS +=	-Wformat-y2k
+WARNINGS +=	-Winit-self
 # the following 2 do not work yet and need more work on it
 #WARNINGS +=	-Wconversion
 #WARNINGS +=	-Wredundant-decls
-- 
1.7.7.6





More information about the Olsr-dev mailing list