Skip to contentSkip to conversation

linux-user: Fix warnings caused by missing 'static' attribute

PATCH Applied Stefan Weil 3 participants 3 messages Aug 29, 2015 – Sep 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Fix warnings caused by missing 'static' attribute

Warnings from the Sparse static analysis tool:

linux-user/main.c:40:12: warning:
symbol 'filename' was not declared. Should it be static?
linux-user/main.c:41:12: warning:
symbol 'argv0' was not declared. Should it be static?
linux-user/main.c:42:5: warning:
symbol 'gdbstub_port' was not declared. Should it be static?
linux-user/main.c:43:11: warning:
symbol 'envlist' was not declared. Should it be static?

---
 linux-user/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
linux-user/main.c +4 -4
index 2c9658e..b5eafef 100644
@@ -37,10 +37,10 @@
 char *exec_path;
 
 int singlestep;
-const char *filename;
-const char *argv0;
-int gdbstub_port;
-envlist_t *envlist;
+static const char *filename;
+static const char *argv0;
+static int gdbstub_port;
+static envlist_t *envlist;
 static const char *cpu_model;
 unsigned long mmap_min_addr;
 unsigned long guest_base;
Signature · 1 line
2.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Stefan Weil

Warnings from the Sparse static analysis tool:

linux-user/main.c:40:12: warning:
symbol 'filename' was not declared. Should it be static?
linux-user/main.c:41:12: warning:
symbol 'argv0' was not declared. Should it be static?
linux-user/main.c:42:5: warning:
symbol 'gdbstub_port' was not declared. Should it be static?
linux-user/main.c:43:11: warning:
symbol 'envlist' was not declared. Should it be static?

Quoted 2 lines

---

thanks
-- PMM

#2 lore raw
In reply to Stefan Weil
Quoted 10 lines · Stefan Weil

Warnings from the Sparse static analysis tool:

linux-user/main.c:40:12: warning:
symbol 'filename' was not declared. Should it be static?
linux-user/main.c:41:12: warning:
symbol 'argv0' was not declared. Should it be static?
linux-user/main.c:42:5: warning:
symbol 'gdbstub_port' was not declared. Should it be static?
linux-user/main.c:43:11: warning:
symbol 'envlist' was not declared. Should it be static?

Applied to -trivial, thanks!

/mjt