[U-Boot] [PATCH] Fix compiler warning in imximage.c due to getline prototype

Kumar Gala galak at kernel.crashing.org
Wed Jan 27 06:16:45 CET 2010


imximage.c: In function 'imximage_parse_cfg_file':
imximage.c:142: warning: implicit declaration of function 'getline'

Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
---
Not sure if this is how we want to fix this or not.

- k

 tools/os_support.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/os_support.h b/tools/os_support.h
index 7dcbee4..4a63351 100644
--- a/tools/os_support.h
+++ b/tools/os_support.h
@@ -19,6 +19,13 @@
 #ifndef __OS_SUPPORT_H_
 #define __OS_SUPPORT_H_
 
+/*
+ * We need _GNU_SOURCE defined before #include <stdio.h> for getline prototype
+ */
+#if defined(__linux__)
+#define _GNU_SOURCE
+#endif
+
 #include "compiler.h"
 
 /*
-- 
1.6.0.6



More information about the U-Boot mailing list