small utils.h cleanup (#3821)
This commit is contained in:
parent
5f3ddabd56
commit
6e57cc4323
12
Makefile
12
Makefile
|
@ -522,7 +522,7 @@ $(libcppdir)/forwardanalyzer.o: lib/forwardanalyzer.cpp lib/analyzer.h lib/astut
|
|||
$(libcppdir)/importproject.o: lib/importproject.cpp externals/picojson/picojson.h externals/tinyxml2/tinyxml2.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h
|
||||
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/importproject.o $(libcppdir)/importproject.cpp
|
||||
|
||||
$(libcppdir)/infer.o: lib/infer.cpp lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/mathlib.h lib/utils.h lib/valueflow.h lib/valueptr.h
|
||||
$(libcppdir)/infer.o: lib/infer.cpp lib/calculate.h lib/config.h lib/errortypes.h lib/infer.h lib/mathlib.h lib/valueflow.h lib/valueptr.h
|
||||
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/infer.o $(libcppdir)/infer.cpp
|
||||
|
||||
$(libcppdir)/library.o: lib/library.cpp externals/tinyxml2/tinyxml2.h lib/astutils.h lib/config.h lib/errortypes.h lib/library.h lib/mathlib.h lib/path.h lib/standards.h lib/symboldatabase.h lib/templatesimplifier.h lib/token.h lib/tokenlist.h lib/utils.h lib/valueflow.h
|
||||
|
@ -540,7 +540,7 @@ $(libcppdir)/pathanalysis.o: lib/pathanalysis.cpp lib/astutils.h lib/config.h li
|
|||
$(libcppdir)/pathmatch.o: lib/pathmatch.cpp lib/config.h lib/path.h lib/pathmatch.h lib/utils.h
|
||||
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/pathmatch.o $(libcppdir)/pathmatch.cpp
|
||||
|
||||
$(libcppdir)/platform.o: lib/platform.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/path.h lib/platform.h lib/utils.h
|
||||
$(libcppdir)/platform.o: lib/platform.cpp externals/tinyxml2/tinyxml2.h lib/config.h lib/path.h lib/platform.h
|
||||
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o $(libcppdir)/platform.o $(libcppdir)/platform.cpp
|
||||
|
||||
$(libcppdir)/preprocessor.o: lib/preprocessor.cpp externals/simplecpp/simplecpp.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h
|
||||
|
@ -633,7 +633,7 @@ test/testcharvar.o: test/testcharvar.cpp lib/check.h lib/checkother.h lib/color.
|
|||
test/testclangimport.o: test/testclangimport.cpp lib/clangimport.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testclangimport.o test/testclangimport.cpp
|
||||
|
||||
test/testclass.o: test/testclass.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
test/testclass.o: test/testclass.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testclass.o test/testclass.cpp
|
||||
|
||||
test/testcmdlineparser.o: test/testcmdlineparser.cpp cli/cmdlineparser.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h test/redirect.h test/testsuite.h
|
||||
|
@ -642,7 +642,7 @@ test/testcmdlineparser.o: test/testcmdlineparser.cpp cli/cmdlineparser.h lib/col
|
|||
test/testcondition.o: test/testcondition.cpp externals/simplecpp/simplecpp.h externals/tinyxml2/tinyxml2.h lib/check.h lib/checkcondition.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testcondition.o test/testcondition.cpp
|
||||
|
||||
test/testconstructors.o: test/testconstructors.cpp lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
test/testconstructors.o: test/testconstructors.cpp lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testconstructors.o test/testconstructors.cpp
|
||||
|
||||
test/testcppcheck.o: test/testcppcheck.cpp lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/timer.h lib/utils.h test/testsuite.h
|
||||
|
@ -705,7 +705,7 @@ test/testpath.o: test/testpath.cpp lib/color.h lib/config.h lib/errorlogger.h li
|
|||
test/testpathmatch.o: test/testpathmatch.cpp lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/pathmatch.h lib/suppressions.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testpathmatch.o test/testpathmatch.cpp
|
||||
|
||||
test/testplatform.o: test/testplatform.cpp externals/tinyxml2/tinyxml2.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/platform.h lib/suppressions.h lib/utils.h test/testsuite.h
|
||||
test/testplatform.o: test/testplatform.cpp externals/tinyxml2/tinyxml2.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/platform.h lib/suppressions.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testplatform.o test/testplatform.cpp
|
||||
|
||||
test/testpostfixoperator.o: test/testpostfixoperator.cpp lib/check.h lib/checkpostfixoperator.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
|
@ -777,7 +777,7 @@ test/testuninitvar.o: test/testuninitvar.cpp lib/check.h lib/checkuninitvar.h li
|
|||
test/testunusedfunctions.o: test/testunusedfunctions.cpp lib/check.h lib/checkunusedfunctions.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testunusedfunctions.o test/testunusedfunctions.cpp
|
||||
|
||||
test/testunusedprivfunc.o: test/testunusedprivfunc.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/symboldatabase.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
test/testunusedprivfunc.o: test/testunusedprivfunc.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkclass.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) $(UNDEF_STRICT_ANSI) -c -o test/testunusedprivfunc.o test/testunusedprivfunc.cpp
|
||||
|
||||
test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
|
||||
|
|
|
@ -339,10 +339,10 @@ static void print_stacktrace(FILE* output, bool demangling, int maxdepth, bool l
|
|||
}
|
||||
#undef ADDRESSDISPLAYLENGTH
|
||||
#else
|
||||
UNUSED(output);
|
||||
UNUSED(demangling);
|
||||
UNUSED(maxdepth);
|
||||
UNUSED(lowMem);
|
||||
(void)output;
|
||||
(void)demangling;
|
||||
(void)maxdepth;
|
||||
(void)lowMem;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
|
|||
type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2;
|
||||
}
|
||||
#else
|
||||
UNUSED(context);
|
||||
(void)context;
|
||||
killid = getpid();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -217,7 +217,8 @@ static std::string addFiles2(std::map<std::string, std::size_t> &files,
|
|||
dirent entry;
|
||||
char buf[sizeof(*dir_result) + (sizeof(dir_result->d_name) > 1 ? 0 : NAME_MAX + 1)];
|
||||
} dir_result_buffer;
|
||||
UNUSED(dir_result_buffer.buf); // do not trigger cppcheck itself on the "unused buf"
|
||||
// TODO: suppress instead?
|
||||
(void)dir_result_buffer.buf; // do not trigger cppcheck itself on the "unused buf"
|
||||
std::string new_path;
|
||||
new_path.reserve(path.length() + 100);// prealloc some memory to avoid constant new/deletes in loop
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "settings.h"
|
||||
#include "symboldatabase.h"
|
||||
#include "token.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
#include "valueptr.h"
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "config.h"
|
||||
#include "errortypes.h"
|
||||
#include "utils.h"
|
||||
|
||||
class Function;
|
||||
class Library;
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "symboldatabase.h"
|
||||
#include "token.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "errortypes.h"
|
||||
#include "mathlib.h"
|
||||
#include "symboldatabase.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include <list>
|
||||
|
|
|
@ -23,9 +23,7 @@
|
|||
|
||||
#include "check.h"
|
||||
#include "config.h"
|
||||
#include "symboldatabase.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
|
@ -37,6 +35,11 @@
|
|||
class ErrorLogger;
|
||||
class Settings;
|
||||
class Token;
|
||||
class Function;
|
||||
class Scope;
|
||||
class SymbolDatabase;
|
||||
class Type;
|
||||
class Variable;
|
||||
|
||||
namespace CTU {
|
||||
class FileInfo;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "config.h"
|
||||
#include "mathlib.h"
|
||||
#include "errortypes.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "errortypes.h"
|
||||
#include "library.h"
|
||||
#include "settings.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "symboldatabase.h"
|
||||
#include "token.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "check.h"
|
||||
#include "config.h"
|
||||
#include "errortypes.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "check.h"
|
||||
#include "config.h"
|
||||
#include "library.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "symboldatabase.h"
|
||||
#include "token.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <unordered_set>
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "config.h"
|
||||
#include "errortypes.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "symboldatabase.h"
|
||||
#include "token.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include "checkuninitvar.h" // CheckUninitVar::isVariableUsage
|
||||
|
@ -41,6 +40,7 @@
|
|||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <numeric>
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "check.h"
|
||||
#include "config.h"
|
||||
#include "errortypes.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "config.h"
|
||||
#include "errortypes.h"
|
||||
#include "tokenize.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "ctu.h"
|
||||
#include "mathlib.h"
|
||||
#include "errortypes.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include <list>
|
||||
|
|
26
lib/config.h
26
lib/config.h
|
@ -69,4 +69,30 @@
|
|||
#include <string>
|
||||
static const std::string emptyString;
|
||||
|
||||
// Use the nonneg macro when you want to assert that a variable/argument is not negative
|
||||
#ifdef __CPPCHECK__
|
||||
#define nonneg __cppcheck_low__(0)
|
||||
#elif defined(NONNEG)
|
||||
// Enable non-negative values checking
|
||||
// TODO : investigate using annotations/contracts for stronger value checking
|
||||
#define nonneg unsigned
|
||||
#else
|
||||
// Disable non-negative values checking
|
||||
#define nonneg
|
||||
#endif
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(address_sanitizer)
|
||||
#define ASAN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ASAN
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
#define ASAN 1
|
||||
#else
|
||||
#define ASAN 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // configH
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "token.h"
|
||||
#include "tokenize.h"
|
||||
#include "tokenlist.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "check.h"
|
||||
#include "errorlogger.h"
|
||||
#include "mathlib.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "path.h"
|
||||
#include "token.h"
|
||||
#include "tokenlist.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
|
|
@ -142,7 +142,6 @@
|
|||
#include "token.h"
|
||||
#include "tokenize.h"
|
||||
#include "tokenlist.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <cctype>
|
||||
#include <climits>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include "path.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
//---------------------------------------------------------------------------
|
||||
|
||||
#include "config.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <climits>
|
||||
#include <string>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "settings.h"
|
||||
#include "symboldatabase.h"
|
||||
#include "token.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h"
|
||||
#include "valueptr.h"
|
||||
|
||||
|
@ -35,6 +36,7 @@
|
|||
#include <list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -19,9 +19,12 @@
|
|||
#ifndef GUARD_PROGRAMMEMORY_H
|
||||
#define GUARD_PROGRAMMEMORY_H
|
||||
|
||||
#include "config.h"
|
||||
#include "mathlib.h"
|
||||
#include "utils.h"
|
||||
#include "valueflow.h" // needed for alias
|
||||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include <limits>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "library.h"
|
||||
#include "mathlib.h"
|
||||
#include "token.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <cctype>
|
||||
#include <iosfwd>
|
||||
|
@ -34,7 +33,6 @@
|
|||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <map>
|
||||
#include <memory>
|
||||
#include <stack>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
static Token *skipRequires(Token *tok)
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "config.h"
|
||||
#include "errortypes.h"
|
||||
#include "tokenlist.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <iosfwd>
|
||||
#include <list>
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "token.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
|
28
lib/utils.h
28
lib/utils.h
|
@ -154,32 +154,4 @@ CPPCHECKLIB bool matchglob(const std::string& pattern, const std::string& name);
|
|||
|
||||
CPPCHECKLIB bool matchglobs(const std::vector<std::string> &patterns, const std::string &name);
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
// Use the nonneg macro when you want to assert that a variable/argument is not negative
|
||||
#ifdef __CPPCHECK__
|
||||
#define nonneg __cppcheck_low__(0)
|
||||
#elif defined(NONNEG)
|
||||
// Enable non-negative values checking
|
||||
// TODO : investigate using annotations/contracts for stronger value checking
|
||||
#define nonneg unsigned
|
||||
#else
|
||||
// Disable non-negative values checking
|
||||
#define nonneg
|
||||
#endif
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(address_sanitizer)
|
||||
#define ASAN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ASAN
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
#define ASAN 1
|
||||
#else
|
||||
#define ASAN 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "mathlib.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
|
Loading…
Reference in New Issue