[Skiboot] [PATCH 01/10] Silence sparse warning for version.c

Stewart Smith stewart at linux.ibm.com
Thu Jul 18 16:51:08 AEST 2019


version.c:1:12: warning: symbol 'version' was not declared. Should it be static?

Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 Makefile.main | 1 +
 core/init.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Makefile.main b/Makefile.main
index fac6e4487460..56fa2bae9e14 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -303,6 +303,7 @@ version.c: $(SRC)/make_version.sh $(OBJS_NO_VER) .version
 	@(if [ "a$(VERSION)" = "a" ]; then \
 		echo "#error You need to set SKIBOOT_VERSION environment variable" > $@ ;\
         else \
+		echo "extern const char version[];"; \
                 echo "const char version[] = \"$(VERSION)\";" ;\
         fi) > $@
 
diff --git a/core/init.c b/core/init.c
index 271736be8325..c99302c86500 100644
--- a/core/init.c
+++ b/core/init.c
@@ -57,6 +57,7 @@
 enum proc_gen proc_gen;
 unsigned int pcie_max_link_speed;
 bool verbose_eeh;
+extern const char version[];
 
 static uint64_t kernel_entry;
 static size_t kernel_size;
-- 
2.21.0



More information about the Skiboot mailing list