diff --git a/BuildSystem/license_scanner.py b/BuildSystem/license_scanner.py index 224bc28..386ffc3 100755 --- a/BuildSystem/license_scanner.py +++ b/BuildSystem/license_scanner.py @@ -106,7 +106,9 @@ def _merge_prereq_dependancies(licenses: Dict, prereq: str): for entry in data['dependencies']: key = entry['moduleName'] if key in licenses: - bisect.insort(licenses[key]['x-usedBy'], key) + for usedby in entry['x-usedBy']: + if usedby not in licenses[key]['x-usedBy']: + bisect.insort(licenses[key]['x-usedBy'], usedby) else: licenses[key] = entry diff --git a/Sources/contract.hpp b/Sources/contract.hpp index 0307f34..393fe4d 100644 --- a/Sources/contract.hpp +++ b/Sources/contract.hpp @@ -10,6 +10,7 @@ #ifndef ksscontract_contract_hpp #define ksscontract_contract_hpp +#include #include #include @@ -33,6 +34,10 @@ namespace kss { namespace contract { inline void precondition(const Expression& exp) { performTerminatingCheck("Precondition", exp); +#if defined(__clang_analyzer__) + // This is used to make the static analyzer recognize the change in the flow. + assert(exp.result); +#endif } inline void condition(const Expression& exp) { @@ -51,6 +56,11 @@ namespace kss { namespace contract { */ # define KSS_EXPR(expr) kss::contract::_private::Expression {(expr), #expr, __PRETTY_FUNCTION__, __FILE__, __LINE__} +#if defined(__clang_analyzer__) + // This is used to make the static analyzer recognize the change in the flow. +# undef KSS_EXPR +# define KSS_EXPR(expr) (static_cast(assert(expr)), kss::contract::_private::Expression {(expr), #expr, __PRETTY_FUNCTION__, __FILE__, __LINE__}) +#endif /*! The parameter check is a form of precondition that is presumed to be checking diff --git a/Sources/invariant.hpp b/Sources/invariant.hpp index 2d63978..cfc36d8 100644 --- a/Sources/invariant.hpp +++ b/Sources/invariant.hpp @@ -10,6 +10,7 @@ #ifndef ksscontract_invariant_hpp #define ksscontract_invariant_hpp +#include #include #include #include