cppcheck/test
Miika-Petteri Matikainen 26816ed954 Fixes preprocessor regression causing hang
Cppcheck 1.76 introduced a regression in preprocessor which causes
the following code to hang:

    $ cat > test.c << EOF
    #ifndef Y
    #else
    #endif
    EOF
    $ cppcheck -D BAR --force test.c
    Checking test.c ...
    ^C

This used to work with version 1.75. Git bisect reveals that this
regression was caused by commit:
ff036c8742

This commit fixes the regression by avoiding infinite loop in
hasDefine(). If cfg is empty string "", we can skip the whole loop
and exit early.
2016-10-11 19:56:13 +03:00
..
cfg Running astyle; Improved testing of std::find; std.cfg: Added support for istream::read and ifstream::read. 2016-08-25 19:17:07 +02:00
CMakeLists.txt Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
options.cpp Unify and simplify addresses computation 2016-07-21 15:48:48 +03:00
options.h Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
redirect.h Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
test.cxx
test64bit.cpp Fixed #7553 (False positive with 1.74 'returning an integer in a function with pointer return type' when no integer is used) 2016-07-29 21:53:58 +02:00
testassert.cpp Fixed #7130 (Wrong assignmentInAssert when using lambda in predicate function) 2016-05-26 18:29:29 +02:00
testastutils.cpp Fixed #7144 (Tokenizer::isScopeNoReturn: handling '{ { throw new string(..); } }') 2016-01-18 15:39:20 +01:00
testautovariables.cpp Support prefix-increment/decrement in CheckAutoVariables::assignFunctionArg() (#3177) 2016-10-10 21:34:40 +02:00
testbool.cpp Correct false positives compareBoolExpressionWithInt (0U) 2016-02-19 21:38:54 +01:00
testboost.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testbufferoverrun.cpp Refactorized CheckBufferOverrun: 2016-07-27 17:28:43 +02:00
testcharvar.cpp Portability warning when 'char' type is used as array index 2016-02-08 10:08:35 +03:00
testclass.cpp Fixed #5839 (False positive: Function can be const, if this is passed to functor) 2016-09-04 16:36:04 +02:00
testcmdlineparser.cpp Settings: Remove '_' prefix for public member variables 2016-01-03 16:18:17 +01:00
testcondition.cpp Improved Check: Warn about number and char literals in boolean expressions (#7750) 2016-10-09 13:21:00 +02:00
testconstructors.cpp Ticket #7068: Treat "memset(&this->member, ..." as member initialization. 2016-10-01 13:46:58 +02:00
testcppcheck.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testerrorlogger.cpp Always set ErrorMessage::file0 to ensure that the source file that cppcheck is checking when an error occurs can be identified 2016-07-26 16:28:40 +02:00
testexceptionsafety.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testfilelister.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testfiles.pri Fixed #7177 (Support compile_commands.json) 2016-08-13 10:50:03 +02:00
testfunctions.cpp Do not warn about alloca() in C89 mode (#7558) 2016-06-20 09:30:41 +02:00
testgarbage.cpp Fixed crash on garbage code (#7699) 2016-08-21 11:06:48 +02:00
testimportproject.cpp Fixed #7177 (Support compile_commands.json) 2016-08-13 10:50:03 +02:00
testincompletestatement.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testinternal.cpp testinternal: add testcase for TP warning for "previous()->next()" 2016-08-25 16:09:06 +02:00
testio.cpp CheckIO: Changed severity for '.. aka' warnings to portability. If type is compatible then it's just a possible portability issue. 2016-09-11 17:05:01 +02:00
testleakautovar.cpp CheckLeakAutoVar: Distinguish between new and new[] (#888) 2016-10-09 10:28:19 +02:00
testlibrary.cpp Fixed #7338 (Library: method in base class) 2016-09-04 14:14:21 +02:00
testmathlib.cpp Fixed #7177 (MathLib: Does not handle '\xF6' properly) 2016-08-28 11:37:05 +02:00
testmemleak.cpp Ticket #7680: Properly handle ::delete during memory leak checks. 2016-09-10 14:55:50 +02:00
testnullpointer.cpp New check: Pointer overflow (null pointer subtracted) 2016-10-09 15:15:29 +02:00
testoptions.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testother.cpp Show struct member in unsignedLessThanZeroError warning 2016-09-22 08:03:30 +07:00
testpath.cpp Path: Add methods Path::isAbsolute() and Path::getCurrentPath() 2016-10-02 12:06:55 +02:00
testpathmatch.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testpostfixoperator.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testpreprocessor.cpp Fixes preprocessor regression causing hang 2016-10-11 19:56:13 +03:00
testrunner.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testrunner.vcxproj Fixed Visual Studio build after pathmatch.h/cpp was moved to lib, fixed compiler errors about getcwd 2016-10-02 15:48:03 +02:00
testrunner.vcxproj.filters Fixed Visual Studio build after pathmatch.h/cpp was moved to lib, fixed compiler errors about getcwd 2016-10-02 15:48:03 +02:00
testsamples.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testsimplifytemplate.cpp Cleanup Tokenizer 2016-07-25 12:12:11 +02:00
testsimplifytokens.cpp Fixed 7698 (FP syntaxError with enum (1.75 regression)) 2016-08-19 19:09:52 +02:00
testsimplifytypedef.cpp Ticket #7541: Properly keep track of namespace definition end markers when there are multiple of them. 2016-10-01 20:46:33 +02:00
testsizeof.cpp Fixed #7582 (false positive: Division by result of sizeof(). strncpy() expects a size in bytes) 2016-07-17 15:22:14 +02:00
teststl.cpp Fixed #7658 (False positive: Same iterator is used with different containers) 2016-08-14 10:49:48 +02:00
teststring.cpp charLiteralWithCharPtrCompare: Improved warning to catch any char literal 2016-10-09 11:39:20 +02:00
testsuite.cpp Fixed #7637 (FP syntax error assignment in switch) 2016-07-26 12:15:55 +02:00
testsuite.h Fixed #7637 (FP syntax error assignment in switch) 2016-07-26 12:15:55 +02:00
testsuppressions.cpp Fixed #5746 (Cppcheck returns error-exitcode when globally suppressed error is encounted when running with multiple jobs.) 2016-05-27 20:13:51 +02:00
testsymboldatabase.cpp Fixed #7713 (False positive: %hhu in format string (no. 1) requires 'unsigned char' but the argument type is 'signed int'.) 2016-08-26 19:47:36 +02:00
testthreadexecutor.cpp Settings: Remove '_' prefix for public member variables 2016-01-03 16:18:17 +01:00
testtimer.cpp Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testtoken.cpp Token: Allow dollar sign in identifiers 2016-07-29 13:42:11 +02:00
testtokenize.cpp Fixed #7747 (Syntax error when setting the bitcount of an enum defined inside a struct) 2016-10-04 15:57:43 +02:00
testtokenlist.cpp Fixed #7424 (value type: wrong sign) 2016-03-18 10:30:57 +01:00
testtype.cpp Removed enum mismatch checker. Ticket #6960. 2016-05-29 18:00:37 +02:00
testuninitvar.cpp new can initialize memory, don't warn in this case (#7623) 2016-10-08 10:03:09 +02:00
testunusedfunctions.cpp Merge pull request #745 from lanurmi/2016_ad 2016-01-01 22:57:19 +01:00
testunusedprivfunc.cpp Fixed #6674 (false positive 'unusedPrivateFunction' - calling virtual function in subclass) 2016-05-21 20:07:35 +02:00
testunusedvar.cpp Improved check: Complain if a variable is modified but not used again 2016-10-10 21:27:40 +02:00
testutils.h Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
testvaarg.cpp Fixed crash in CheckVaarg::va_list_usage() (#7559) 2016-06-20 09:24:23 +02:00
testvalueflow.cpp Fixed #7139 (ValueFlow: Missed shift operation in for expression) 2016-10-04 13:09:33 +07:00
testvarid.cpp Fixed #7740 (Tokenizer::setVarId: Function declaration does not start with 'return') 2016-10-03 10:02:18 +02:00