1From 82becbadd5918ed7ad3c2b651ce479084b5feb2a Mon Sep 17 00:00:00 2001 2From: Etienne Carriere <etienne.carriere@linaro.org> 3Date: Mon, 10 May 2021 15:58:41 +0200 4Subject: core: zlib: fix build warning when _LFS64_LARGEFILE is not defined 5 6In zlib, _LFS64_LARGEFILE is expected to be a boolean directive, either 71 (true) or 0 (false). Depending on toolchain version and directives 8build may produces warnings (as shown below with gcc 9.3) when the macro 9is not defined hence this change to default it to value 0 (false). 10 11core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef] 12 196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) 13 | ^~~~~~~~~~~~~~~~ 14In file included from core/lib/zlib/adler32.c:9: 15core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef] 16 196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) 17 | ^~~~~~~~~~~~~~~~ 18 CC out/core/lib/zlib/zutil.o 19In file included from core/lib/zlib/inftrees.c:7: 20core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef] 21 196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) 22 | ^~~~~~~~~~~~~~~~ 23In file included from core/lib/zlib/inflate.c:84: 24core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef] 25 196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) 26 | ^~~~~~~~~~~~~~~~ 27In file included from core/lib/zlib/zutil.c:9: 28core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef] 29 196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) 30 | ^~~~~~~~~~~~~~~~ 31 32Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> 33Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> 34--- 35 core/lib/zlib/zconf.h | 5 +++++ 36 1 file changed, 5 insertions(+) 37 38diff --git a/core/lib/zlib/zconf.h b/core/lib/zlib/zconf.h 39index 0bca18be..a7d13741 100644 40--- a/core/lib/zlib/zconf.h 41+++ b/core/lib/zlib/zconf.h 42@@ -487,6 +487,11 @@ typedef uLong FAR uLongf; 43 # endif 44 #endif 45 46+/* Other places expect _LFS64_LARGEFILE to be defined with a valid value */ 47+#ifndef _LFS64_LARGEFILE 48+#define _LFS64_LARGEFILE 0 49+#endif 50+ 51 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 52 # define Z_LFS64 53 #endif 54-- 552.17.1 56 57