Commit Graph

391 Commits

Author SHA1 Message Date
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 099b4435c3 Fixed #8074 (Preprocessor::getConfigs: wrong configuration extracted 'A;B;;') 2017-05-24 11:16:41 +02:00
Daniel Marjamäki 899615c1e4 update simplecpp includes
[ci skip]
2017-05-18 22:26:07 +02:00
Daniel Marjamäki 1f4b84379d Fix for #pragma asm 2017-05-17 21:58:46 +02:00
Daniel Marjamäki 67e3187653 Preprocessor: Refactor handling of #pragma asm 2017-05-17 10:25:37 +02:00
Daniel Marjamäki e72ec4282d Fixed #7842 (Preprocessor::getConfigs: #error in #ifndef not handled well) 2017-04-22 12:44:57 +02:00
Daniel Marjamäki d403a6a883 Preprocessor::getConfigs: Remove bad configurations when #error is seen 2017-04-02 12:15:53 +02:00
Daniel Marjamäki 7eb95aac2a Preprocessor::getConfigs: Handle #error in '#if !A' better 2017-04-02 10:06:39 +02:00
Daniel Marjamäki edd1c32e5b Preprocessor::getConfigs: Better handling of ! in #if 2017-04-02 09:03:43 +02:00
Daniel Marjamäki 865588950a Preprocessor: quick fix for #7939 2017-03-22 10:53:21 +01:00
Simon Martin 43e4364675 Ticket #7912: Properly preprocess files with decreasing line numbers, due to #line directives. 2017-03-05 16:46:43 +01:00
Matthias Krüger 064a4aa4cc improve constness of functions as per cppchecks suggestions. 2017-01-07 14:31:03 +01:00
PKEuS cfac3b457d Several small refactorizations 2016-12-06 22:12:02 +01:00
Daniel Marjamäki 9c69546d72 Fixed #7842 (Preprocessor::getConfigs: #error in #ifndef not handled well) 2016-12-03 11:59:48 +01:00
Daniel Marjamäki b04f6fb359 bump simplecpp to rev d1c995c03515d289c7aa7246a74d666fd012c4eb 2016-11-10 20:04:05 +01:00
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
Daniel Marjamäki b97bdb5300 bump simplecpp to rev b50ced8ac14f8debab9e85e78036f881ff2b3965 2016-09-03 12:29:45 +02:00
Daniel Marjamäki d9ebdc6a10 Preprocessor: fix handling of -U in Preprocessor::getConfigs() 2016-08-21 15:01:04 +02:00
Daniel Marjamäki ff036c8742 Fixed #7700 (Using -D to force a configuration still checks the configuration as well as configurations that are not relevant) 2016-08-21 13:53:44 +02:00
Daniel Marjamäki d982dc5ffe TestPreprocessor: Refactoring 2016-08-21 08:06:20 +02:00
Daniel Marjamäki 363605906f Fixed #7695 (Running with -U_WIN32 still checks related configurations) 2016-08-21 07:45:15 +02:00
Daniel Marjamäki b86c2689b3 TestPreprocessor: Fix output 2016-08-06 13:28:24 +02:00
Daniel Marjamäki cbfeae0ff7 bump simplecpp 2016-08-04 22:53:10 +02:00
Daniel Marjamäki 695b1f0ef3 Fixed #5692 (Preprocessor: ifdef symbol used indirectly in code leads to 'analysis failed') 2016-08-01 20:09:41 +02:00
Daniel Marjamäki d89a646ed9 TestPreprocessor refactorings 2016-07-30 20:22:07 +02:00
Daniel Marjamäki 0777ecd071 Fixed #7640 (Preprocessor::getConfigs: -U is not honored) 2016-07-28 19:22:59 +02:00
PKEuS 9a6569fde1 Always set ErrorMessage::file0 to ensure that the source file that cppcheck is checking when an error occurs can be identified
Removed unused function and unused includes from preprocessor.h/cpp
2016-07-26 16:28:40 +02:00
Daniel Marjamäki 2feb86a6af Preprocessor: set platform info 2016-07-25 14:52:23 +02:00
Daniel Marjamäki 90faa80590 Preprocessor: Cleanup unused functions 2016-07-25 14:29:02 +02:00
Daniel Marjamäki e9fef003ac Preprocessor: refactoring directives, they are now only set once for each file 2016-07-24 14:02:21 +02:00
Daniel Marjamäki 99307846cf Preprocessor: simplecpp optimisations 2016-07-21 19:42:26 +02:00
Daniel Marjamäki e16f0e500c Preprocessor: Parse comments and then remove them 2016-07-21 07:48:17 +02:00
Daniel Marjamäki 03d2829fb9 Merge simplecpp branch 2016-07-20 12:21:00 +02:00
Daniel Marjamäki 3eef225b36 Revert preprocessor fix for struct tag macros. There are performance problems. 2016-07-19 18:59:58 +02:00
Mavik 3e86c7b637 Fixed #5700 (Defect: False positives due to failure to expand struct tag macros) 2016-07-19 16:52:53 +02:00
Daniel Marjamäki a87b4368cb Revert "Preprocessor: Start replacing our Preprocessor code with simplecpp"
This reverts commit 9820783b60.

There was Travis errors I'll need to look more at.
2016-07-07 23:45:42 +02:00
Daniel Marjamäki 9820783b60 Preprocessor: Start replacing our Preprocessor code with simplecpp 2016-07-07 22:58:56 +02:00
Simon Martin 3095f47a7b Ticket #7137: Properly detect C++14 digit separators. (#802)
Add an optional extended description…
2016-06-04 22:55:55 +02:00
Daniel Marjamäki 2b2f12bcd5 Fixed #6758 (Preprocessor: handle #__VA_ARGS__) 2016-05-28 11:27:45 +02:00
Daniel Marjamäki c5c376513b Fixed #7102 (Preprocessor: skip __cplusplus sections in headers when .c file is checked) 2016-02-29 07:34:06 +01:00
Albert ARIBAUD (3ADEV) 38e70dfb74 Preprocessor directives for addons
This patch augments the XML dumps with a 'directivelist'
subnode which lists all raw preprocessor directives met
while reading the source code in each configuration.

Also, the addons/cppcheckdata.py file has been extended
to give easy access to the list of directives and to
provide Python support for the --template (or short -t)
option.

Finally, an new addon, addons/y2038/y2038.py, is created
to detect when a glibc symbol might be Y2038-sensitive,
based on whether and how _TIME_BITS and _USE_TIME_BITS64
are defined when meeting the symbol.
2016-01-15 12:36:35 +01:00
Daniel Marjamäki 79e663dd6f Settings: Remove '_' prefix for public member variables 2016-01-03 16:18:17 +01:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Daniel Marjamäki 83cb028963 Preprocessor: insert space between ++ or -- in macro expansion 2015-12-29 06:54:44 +01:00
Matthias Krüger c7bbc27130 Preprocessor: run paths of some error messages through Path::simplifyPath()
teach Path::simplifyPath() to recursively remove "./././" from beginning of paths.
2015-11-30 19:30:37 +01:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
PKEuS 52be380ef0 Fixed fix for #7042 - support hexadecimal digits 2015-10-18 16:37:33 +02:00
PKEuS a97f6f973f Support C++14 digit separators (#7042) 2015-10-14 12:00:54 +02:00
PKEuS 70dce7701a Refactorization: Reduced code duplication in testpreprocessor.cpp 2015-10-09 12:27:39 +02:00
PKEuS 0fa3b8806c Refactorization: Use '\x..' syntax to avoid cast and "#pragma warning". 2015-10-07 19:41:54 +02:00