aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-04-14 14:36:21 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-28 17:53:38 +0100
commit95a2a27f2c461007b00aab6d39c6d5c0631e1a73 (patch)
treefb0ff7c516e5d83e47ee77173feebef764b46926
parent97667031b17b2e6b6a74cb85ff97c4cacd88d330 (diff)
downloadsparse-95a2a27f2c461007b00aab6d39c6d5c0631e1a73.tar.gz
allow to test the standard version outside of lib.c
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@gmail.com>
-rw-r--r--lib.c8
-rw-r--r--lib.h11
2 files changed, 12 insertions, 7 deletions
diff --git a/lib.c b/lib.c
index 7866800b..97d8af39 100644
--- a/lib.c
+++ b/lib.c
@@ -318,13 +318,7 @@ int funsigned_char = -1;
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;
static int arch_msize_long = 0;
int arch_m64 = ARCH_M64_DEFAULT;
diff --git a/lib.h b/lib.h
index 684a4955..1eb45561 100644
--- a/lib.h
+++ b/lib.h
@@ -224,6 +224,17 @@ enum {
};
extern int arch_cmodel;
+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);