Powered by Linux
[PATCH 1/8] allow to test the standard version outside of lib.c — Semantic Matching Tool

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>

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 <luc.vanoostenryck@xxxxxxxxx>
Signed-off-by: John Levon <john.levon@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux