Commit Graph

408 Commits

Author SHA1 Message Date
Daniel Marjamäki 08ddd84780 Update copyright year 2020-05-10 11:16:32 +02:00
Daniel Marjamäki 3e0218299b Revert "Update copyright year"
This reverts commit 6eec6c4bd5.
2020-05-10 11:13:05 +02:00
Daniel Marjamäki 6eec6c4bd5 Update copyright year 2020-05-10 11:11:34 +02:00
Dmitry-Me b51e4dfeea Improved test to have all lines reached 2020-03-27 19:11:38 +03:00
Oliver Stöneberg de9f489b08 use range loops / constness (#2181)
* use range loops / constness

* platform.cpp: avoid shadowed variable
2019-09-19 20:29:33 +02:00
Daniel Marjamäki 5a6b89100d Removed casts 2019-07-16 09:14:44 +02:00
Scott Furry a195477470 Correct Zero/Null as pointer constant (#1938)
Building with enhanced clang warnings indicated a large number of
instances with the warning:

`warning: zero as null pointer constant`

Recommended practice in C++11 is to use `nullptr` as value for
a NULL or empty pointer value. All instances where this warning
was encountered were corrected in this commit.

Where warning was encountered in dependency code (i.e. external library)
no chnages were made. Patching will be offered upstream.
2019-06-30 21:39:22 +02:00
Daniel Marjamäki bbb5bfd432 Preprocessor: Test case has been moved to simplecpp 2019-05-03 19:27:08 +02:00
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
Daniel Marjamäki 8dd641b8be Use OVERRIDE in test 2019-01-12 15:45:25 +01:00
PKEuS 86a1b84b0c Fixed handling of macros with known value defined in header file in configuration splitting (#8404)
Added proper unit test for configuration validation to ensure that it actually works when cppcheck is executed
2018-10-08 16:38:47 +02:00
Daniel Marjamäki 45379a3aa6 Updated copyright year for modified files
[ci skip]
2018-06-10 22:07:21 +02:00
orbitcowboy 976e9e2544 Cleared -Wshadow warnings. 2018-05-29 11:54:07 +02:00
IOBYTE ce50df8047 Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
Daniel Marjamäki 6bd4bdb0f9 Updated 'noValidConfiguration' message. It should not write this message when there is no code. It should be possible to see the preprocessor errors otherwise it is hard to fix the configuration. 2018-05-15 15:42:54 +02:00
PKEuS bbfcccf078 Refactorization: Replace several push_back-sequences by initializer lists 2018-04-09 09:41:24 +02:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
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