[PATCH 1/8] allow to test the standard version outside of lib.c

[email protected]
Newsgroups org.kernel.vger.smatch
Message-ID <[email protected]>
From: Luc Van Oostenryck <[email protected]>

Since semantics and supported features can differ between
standard version we may need the supported version.

Allow this by moving the variable 'standard' and the corresponding
enum definition to lib.h

Signed-off-by: Luc Van Oostenryck <[email protected]>
Signed-off-by: John Levon <[email protected]>
---
 lib.c |  8 +-------
 lib.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/lib.c b/lib.c
index 569a1533..605e4bb6 100644
--- a/lib.c
+++ b/lib.c
@@ -318,13 +318,7 @@ int funsigned_char = UNSIGNED_CHAR;
 
 int preprocess_only;
 
-static enum { STANDARD_C89,
-              STANDARD_C94,
-              STANDARD_C99,
-              STANDARD_C11,
-              STANDARD_GNU11,
-              STANDARD_GNU89,
-              STANDARD_GNU99, } standard = STANDARD_GNU89;
+enum standard standard = STANDARD_GNU89;
 
 int arch_m64 = ARCH_M64_DEFAULT;
 int arch_msize_long = 0;
diff --git a/lib.h b/lib.h
index de8f1132..ed2c866a 100644
--- a/lib.h
+++ b/lib.h
@@ -206,6 +206,17 @@ extern int arch_msize_long;
 extern int arch_big_endian;
 extern int arch_mach;
 
+enum standard {
+	STANDARD_C89,
+	STANDARD_C94,
+	STANDARD_C99,
+	STANDARD_C11,
+	STANDARD_GNU11,
+	STANDARD_GNU89,
+	STANDARD_GNU99,
+};
+extern enum standard standard;
+
 extern void dump_macro_definitions(void);
 extern struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list **files);
 extern struct symbol_list *__sparse(char *filename);
-- 
2.23.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.