1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Commit graph

61 commits

Author SHA1 Message Date
Marco Stornelli
bacb42110e Bug 546609 - Added checker for magic numbers
Change-Id: Idedcf15f9d5eb3a5d405fe8dc83131f1faf0efa3
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-04 12:09:38 +01:00
Marco Stornelli
2e761a5359 Bug 545714 - Added a shallow copy checker
Change-Id: I8998a98f9d7836405afcaf54bf241b0acbd9edea
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-03 14:11:08 -05:00
Marco Stornelli
55e08c0dfa Bug 273252 - Added checker for variable masking
Added new checker for variable masking another in a parent scope

Change-Id: Icff6b6499a1d38cc5a719d143552bbe17d57b15c
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2020-01-03 02:17:30 -05:00
Marco Stornelli
42daf203a6 Bug 552076 - Fix false positive virtual method with qualified name
Change-Id: Iaf82368fce793f9c23d6e8a13d88bf57282f9ae9
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-10-17 17:54:34 +02:00
Marco Stornelli
fa012eb7d4 Bug 545704 - Added checker for float comparison
Change-Id: Id5529b9bd5ee38bac5f5b7e8adab741f0bce3f8e
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-10-17 00:58:22 -04:00
Marco Stornelli
f8316e315b Bug 545977 - Added checker for variable initialization
Checker checks for multiple declarations on one line and
static variables defined in header files.

Change-Id: Ibc9670ee129e9bdd3ea58ac5409493fd99c4a234
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-10-13 08:29:11 +02:00
Marco Stornelli
6504d1a917 Bug 546173 - Add a check for returning of local variable addresses
Change-Id: Ief17af55c20b6e075381fa22a9208b7dfa67ec0b
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-10-12 09:11:24 +02:00
Marco Stornelli
a159173a51 Bug 545954 - Added checker for functions/methods blacklist
Change-Id: I69d32f166e09ec38e4bf3dd9eaca2643c2e2d01e
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-09-23 01:10:46 -04:00
Marco Stornelli
39be625d8e Bug 549466 - Quick fix with the same resolution
We have the "universal resolution" in an ArrayList and they are used as
single instances. So what can happen here is that we add the same
universal resolution instance multiple times for several markers.
However this approach can't work because a "marker resolution" is
designed to fix a single problem. Indeed the last marker analyzed
override the previous one in the single "universal resolution" instance,
so what we have is N proposals pointing to the same resolution where the
problem description is just the latest one. To solve the problem we
instantiate the universal resolution multiple times.

Change-Id: I072ca0b4dabff9781d6230a218eeb7dd388c648d
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-09-22 07:14:09 -04:00
Alexander Kurtakov
1e42e5f0e1 Convert new Runnable to lambda.
Change-Id: I8b827013a29802a3f3ae6400ddce8d8753eb6399
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
2019-08-12 07:11:40 -04:00
Marco Stornelli
4c0e7d9f68 Bug 545959 - Added checker for assignment operator
Change-Id: Ib48742cbc04679ab9e48349f4d68aea5657d38c9
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-07-23 00:47:39 -04:00
Marco Stornelli
90358f5374 Bug 355174 - Improved tests and code for quickfix
Change-Id: I032040e6c4d3c9342ebdbf72b3ba75114810a31f
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-30 17:41:05 +02:00
Marco Stornelli
1c147d87ce Bug 545699 - Added quickfix for C style cast
Change-Id: Icc1152c013363c5c1b8c2606e3ad0ceb2aa18aa5
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-30 01:09:45 -04:00
Marco Stornelli
3890eec7b7 Bug 355174 - Added quickfix for miss cases/default
Change-Id: I4c815bd55e55d81456efa796453dd2f69a7c876a
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-28 19:48:59 +02:00
Marco Stornelli
1204bf21b1 Bug 545956 - Added checker for virtual methods in ctor/dtor
Change-Id: I63b8a40447e9a5b6080e046030677a13607c4ea3
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-26 20:26:16 +02:00
Marco Stornelli
1065ee7688 Bug 355174 - Added cheker for missing case in a switch
Change-Id: I1ba1193186e275bed450eb7447eefd90dc09ebec
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-26 13:54:27 -04:00
Marco Stornelli
6452688c18 Bug 468742 - Fix false positive no-virtual destructor
Change-Id: Id8d2efaf3f7a5ca74d160e4a726c08a71c6d7067
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-18 02:13:30 -04:00
Marco Stornelli
ec6f9d204d Bug 320786 - Fix false negative assignment in condition
Fix bug with expression list

Change-Id: I25b226ec7fd1edcfc40fe2ebcadbd3bdb2a6a5dd
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-18 02:10:33 -04:00
Marco Stornelli
f90cd7214d Bug 545702 - Added new checker to verify copyright information
Change-Id: I57cad8565ce3c752a41f89473a95d5427d10cc8b
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-16 00:52:48 -04:00
Marco Stornelli
f893b77dba Bug 461435 - Added options to format pointers in methods
Rules used:
1) Default is right alignment to be compliant with built-in formatter
rules;
2) Pointer with declarator without name will be always left alignment
unless there's a nested declarator;
3) Return value of methods/functions is always left alignment;
4) If left alignment is selected, if space after comma is selected too
for a declaration list, space is always forced after the comma.

Change-Id: I82d5ad130e665e5357644cc59655a558f3fb732f
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-12 15:42:21 +02:00
Marco Stornelli
695de049db Bug 458850 - Fix false positive for deferred classes
Change-Id: I46335a94d69ae8d4e5ae1c68857344d1dc513328
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-12 09:59:22 +02:00
Marco Stornelli
db0cc1f9a4 Bug 468749 - Fix false negative no virtual destructor
The checkers simply skipped nested classes.

Change-Id: If464b229e586267d845768f9d96d3223328a8298
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-08 02:23:47 -04:00
Marco Stornelli
838a12d8f4 Bug 545952 - Added checker to check for goto usage
Change-Id: I5f7f157c5c208e686627bb90b001879953d83e70
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-05-08 00:50:59 -04:00
Marco Stornelli
3fcbb5c7b5 Bug 492878 - Fix no-return in function with goto
Change-Id: I39f2605aa2e5b697015a2dfdb795f163e76095cf
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-04-21 13:46:24 -04:00
Doug Schaefer
a7bb1da5e3 Bug 545699 - Add test to suite.
Change-Id: Id8542251403e6e2cc3931500b7f15a036b17a239
2019-04-15 12:07:08 -04:00
Marco Stornelli
60a4cccbe3 Bug 545699 - Added checker for C-style casts in C++
Change-Id: I38076599b354608a4b806f7b1d2ca1f6acc50a44
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-04-15 10:28:39 -04:00
Marco Stornelli
77592ee87a Bug 546179 - Fix lack of warning for field references
With just a reference of the field even for another instance of the
same class the warning wasn't provided to the user.

Change-Id: Icb6ca008c2e61b8a762ecf31e4514cb0368c477d
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-04-07 10:26:15 +02:00
Marco Stornelli
f2635eed74 Bug 545562 - Fix return checker check for template functions
Change-Id: Ie5e3d4560cb3784f6c8393290d64794db56294d7
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-03-21 20:41:26 +01:00
Marco Stornelli
e70a63a424 Bug 519105 - Return checker for functions with noreturn
Added check in control flow graph to check if a function
has noreturn attribute.

Change-Id: Ieaa5984a337493e3aac12c0f6fbeeb91a754358b
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-03-21 19:02:27 +01:00
Marco Stornelli
97e18b4b31 Bug 544980: Added a checker for using directive in header file
Change-Id: Ic77fd2f7504e7a6cc4e15a2fdeb507724db9e74f
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
2019-03-04 09:36:50 -05:00
Bassem Girgis
d8c2330efe Bug 509751 - Process function template with non-dependent return type in ReturnChecker
Change-Id: I8274affff8152dba35233a06cd8cdaef39cf00bb
Signed-off-by: Bassem Girgis <brgirgis@gmail.com>
2019-02-19 18:15:19 -05:00
Jonah Graham
37ed2c406d Bug 540373: Update the compiler warnings/ignores
The previous alignment of all the warnings/ignores
led to too many warnings that weren't there before. This
commit relaxes them a bit.

The core/org.eclipse.cdt.core/.settings/org.eclipse.jdt.core.prefs
is still the "master" copy, with
releng/scripts/check_code_cleanliness.sh containing the
exceptions that apply to test plug-ins.

Change-Id: Ibd4e31ade0b42b31e7cbe5a94f06c6fc15183a56
2018-11-24 10:55:06 +00:00
Jonah Graham
aa1040a21a Bug 540373: Remove '(non-Javadoc)' comments
These were inserted in the past automatically by Eclipse but
newer tooling makes them redundant.

These were removed by doing a global find/replace on *.java files
using the following regular expression:
\t/\*\n\t \* \(non-Javadoc\)[^/]*/\n

Change-Id: I59d3248020f10934fde1dda5b5a31e20bb188e19
2018-11-22 22:00:29 +00:00
Jonah Graham
caf2292768 Bug 540373: Cleanup: Remove redundant type arguments
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Remove redundant type arguments
and completing the wizard

Change-Id: Iaecc7010f097b4b1fabd29ccaa34ccb23a716fbf
2018-11-22 21:55:36 +00:00
Jonah Graham
8985c7b63f Bug 540373: Cleanup: Add missing annotations
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Add missing Annotations - and selecting all three types:
 - @Override
 - @Override on interface methods
 - @Deprecated
and completing the wizard

Change-Id: I5d367dacb04327107f25e147edc08efc4eb1c2fe
2018-11-22 21:51:31 +00:00
Jonah Graham
a923614c73 Bug 540373: Cleanup: Organize Imports
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Organize Imports
and completing the wizard

Change-Id: Ia7b305a4c967d0e6f4e8fb8c1041e7028b24006c
2018-11-22 21:47:02 +00:00
Jonah Graham
170e654b47 Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then
Source -> Clean Up... -> choosing:
- Format source code
- Remove trailing white spaces on all lines
and completing the wizard

Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
2018-11-22 21:47:02 +00:00
Jonah Graham
35996a5c5c Bug 540373: Standard .settings auto applied
The releng/scripts/apply_jdt_prefs_to_all_projects.sh was run to
copy standard settings to all other projects.

Change-Id: I4436c947d7f0142f56b709e661379c3eb54f666b
2018-11-22 21:47:02 +00:00
Jonah Graham
f70a8b35c1 Bug 540371: Update to EPLv2 using releng/scripts/change_to_eplv2.sh
Change-Id: Ifbb1d5af2a00bd5634dea200320e8c4303ffca6c
2018-11-22 20:31:51 +00:00
Jonah Graham
48d2271a58 Bug 540373: Normalize newlines with .gitattributes
There is also a new script to verify completeness of .gitattributes:
releng/scripts/verify_gitattributes.sh

Change-Id: I2ce270852ab54b66b6c474a6ec94203fe5bba78b
2018-11-20 21:20:39 +00:00
Karsten Thoms
652602febd Bug 540610 - Add Automatic-Module-Name header
Change-Id: Ia990b24469751050dd9ec8f9b5550804816308b3
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
2018-10-30 15:49:15 +01:00
Nathan Ridge
a00346af22 Bug 540112 - Perform C++14 return type deduction in ReturnChecker
As part of this change, ReturnChecker was refactored to compute the
return type as an IType, which allowed for removal of some logic in
ReturnChecker which duplicated CPPVisitor's type resolution work.

Change-Id: I9cd8512164d650a5ee11d2e58fdae477e3c428a2
2018-10-28 22:52:37 -04:00
Marc-Andre Laperle
efbda46cba Bug 389577 - False positive "Unused static function"
Add handling of constructor/destructor attributes and some improvement
when functions were previously declared but not defined as used.

Change-Id: I7537bc87c6c4bc5b294d8e15fe5b42c92b3f2974
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2018-10-11 22:43:20 -04:00
Bassem Girgis
ae8442fd6d Bug 519311 Handle delegating constructor in class template
- Fixed delegating constructor resolution for templated classes in
ClassMembersInitializationChecker
- Added a unit test for this bug

Change-Id: Idb072ec05e66e0f10af53db8258459ad14f7f329
Signed-off-by: Bassem Girgis <brgirgis@gmail.com>
2018-10-10 00:09:22 -04:00
Bassem Girgis
9c04b1bcf7 Bug 519473 Fixed member function calling with references
Change-Id: I86d1dfacb6f842be688bfdaf2a6a0faf0ffade09
Signed-off-by: Bassem Girgis <brgirgis@gmail.com>
2018-10-09 23:57:48 -04:00
Marc-Andre Laperle
467aab5559 Bug 539307 - Set correct project nature in Codan tests to fix wrong content type
When the lsp4e-cpp plugin is present, two content types are associated with
.cpp extension. The lsp4e-cpp one is chosen because it happens to be first.
Normally, the CDT C++ content type gets its priority boosted when the C++
project nature is present. Some Codan tests run on .cpp files but without
the C++ project nature so the files are of wrong content type and the tests
fail. Once the nature is fixed, some tests were failing because they should
run on C files but loadCode was not loading them as C++ files because of the
project nature.

Change-Id: I61b77d409e81c3cf78e60adf0c77a9bf976ac9d5
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2018-09-30 19:26:25 -04:00
Nathan Ridge
fa50ca7bc0 Bug 536268 - Find uses of overloaded operators when checking for unused symbols
Change-Id: I4445b62d4419ffa12d505bcc8265492c22f49bb6
2018-07-07 20:17:13 -04:00
Felix Morgner
5ec251a791 Bug 532120: Catch by const reference ignores const placement setting
The original implementation used plain-text string manipulation of the
IDocument. This changeset changes the implementation to make use of the
ASTRewrite infrastructure, which automatically honors the const
placement setting.

Change-Id: Ib5ae9381b93ca8ab4d1ad3e16b1c3c8b1ec62d78
Signed-off-by: Felix Morgner <fmorgner@hsr.ch>
2018-06-03 06:37:37 -04:00
Nathan Ridge
c8b769ead2 Bug 534332 - Add a testcase involving a function as well
Change-Id: I02c4ec4ab2ece8dee09ba6b27461dc76724ebba8
2018-05-17 20:28:36 -04:00
Nathan Ridge
45bbb2bb5b Bug 534332 - In the unused symbol checker, check for 'unused' attribute on the decl-specifier too
Change-Id: Ib4f26e5a04742af93c884819a5b2f1f714faeb97
2018-05-10 22:47:43 -04:00