From 8331330aae836fc8460dde2a60e7bcbf3a6983ea Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 20 Jul 2018 15:46:20 +0200 Subject: [PATCH] cswrap-core: new parameter analyzer_is_cxx_ready --- csclng.c | 2 ++ cscppc.c | 2 ++ cswrap-core.c | 9 +++++++-- cswrap-core.h | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/csclng.c b/csclng.c index 34d55c3..fcab211 100644 --- a/csclng.c +++ b/csclng.c @@ -37,6 +37,8 @@ const char *wrapper_debug_envvar_name = "DEBUG_CSCLNG"; const char *analyzer_name = "clang"; +const bool analyzer_is_cxx_ready = true; + const bool analyzer_is_gcc_compatible = true; static const char *analyzer_def_arg_list[] = { diff --git a/cscppc.c b/cscppc.c index 9c5061a..7fc9ca8 100644 --- a/cscppc.c +++ b/cscppc.c @@ -38,6 +38,8 @@ const char *wrapper_debug_envvar_name = "DEBUG_CSCPPC"; const char *analyzer_name = "cppcheck"; +const bool analyzer_is_cxx_ready = true; + const bool analyzer_is_gcc_compatible = false; static const char *analyzer_def_arg_list[] = { diff --git a/cswrap-core.c b/cswrap-core.c index 85311cc..d718830 100644 --- a/cswrap-core.c +++ b/cswrap-core.c @@ -203,8 +203,13 @@ bool is_bare_def_inc(const char *arg) bool is_input_file_suffix(const char *suffix) { - return STREQ(suffix, "c") - || STREQ(suffix, "C") + if (STREQ(suffix, "c")) + return true; + + if (!analyzer_is_cxx_ready) + return false; + + return STREQ(suffix, "C") || STREQ(suffix, "cc") || STREQ(suffix, "cpp") || STREQ(suffix, "cxx"); diff --git a/cswrap-core.h b/cswrap-core.h index d7a1dd5..86cc9d9 100644 --- a/cswrap-core.h +++ b/cswrap-core.h @@ -34,6 +34,8 @@ extern const char *wrapper_debug_envvar_name; extern const char *analyzer_name; +extern const bool analyzer_is_cxx_ready; + extern const bool analyzer_is_gcc_compatible; extern const char **analyzer_def_argv;