[Crosstoolchain-logs] [device-tree-compiler] 119/198: libfdt: avoid shadowing "err" in FDT_RW_CHECK_HEADER

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:06:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.

commit 3a584d4760cfc81d21039346b0ce1cb5233e1d72
Author: Florian Fainelli <f.fainelli at gmail.com>
Date:   Fri Jan 24 17:19:12 2014 -0800

    libfdt: avoid shadowing "err" in FDT_RW_CHECK_HEADER
    
    FDT_RW_CHECK_HEADER declares an internal variable named "err" which is
    far too generic and will produce the following -Wshadow warnings:
    
    libfdt/fdt_rw.c: In function 'fdt_add_mem_rsv':
    libfdt/fdt_rw.c:177:2: error: declaration of 'err' shadows a previous
    local [-Werror=shadow]
    libfdt/fdt_rw.c:175:6: error: shadowed declaration is here
    [-Werror=shadow]
    libfdt/fdt_rw.c: In function 'fdt_del_mem_rsv':
    libfdt/fdt_rw.c:194:2: error: declaration of 'err' shadows a previous
    local [-Werror=shadow]
    libfdt/fdt_rw.c:192:6: error: shadowed declaration is here
    [-Werror=shadow]
    libfdt/fdt_rw.c: In function 'fdt_set_name':
    ...
    
    Since this variable is only used internally in the macro, rename to
    __err which should be prefixed enough not to cause new shadow warnings.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 libfdt/fdt_rw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index fdba618..70adec6 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -84,9 +84,9 @@ static int _fdt_rw_check_header(void *fdt)
 
 #define FDT_RW_CHECK_HEADER(fdt) \
 	{ \
-		int err; \
-		if ((err = _fdt_rw_check_header(fdt)) != 0) \
-			return err; \
+		int __err; \
+		if ((__err = _fdt_rw_check_header(fdt)) != 0) \
+			return __err; \
 	}
 
 static inline int _fdt_data_size(void *fdt)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list