diff options
author | Marc-Andre Laperle | 2018-09-22 04:46:25 +0000 |
---|---|---|
committer | Marc-André Laperle | 2018-10-12 02:43:20 +0000 |
commit | efbda46cba9dbb17eaebf74013021ea1ab8114fb (patch) | |
tree | 3052982746c8360e193ddd8753aef3b5ec73b51a /codan/org.eclipse.cdt.codan.core.tests | |
parent | 8492296d24dfacd63f21972fd7e91ffd806b250c (diff) | |
download | org.eclipse.cdt-efbda46cba9dbb17eaebf74013021ea1ab8114fb.tar.gz org.eclipse.cdt-efbda46cba9dbb17eaebf74013021ea1ab8114fb.tar.xz org.eclipse.cdt-efbda46cba9dbb17eaebf74013021ea1ab8114fb.zip |
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>
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.tests')
-rw-r--r-- | codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java index 693c06435f5..270a66a7283 100644 --- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java @@ -315,9 +315,16 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase { // int f1() __attribute__((__unused__)); // extern int f2() __attribute__((unused)); // static void f3() __attribute__((unused)); + // void f3() {} // static void f4() __attribute__((unused)); // static void f4() __attribute__((unused)) {} // static void __attribute__((unused)) f5(); + // static void f6() __attribute__((unused)); + // static void f6() {} + // static void __attribute__((unused)) f7(); + // void f7() {} + // static void __attribute__((unused)) f8(); + // static void f8() {} public void testAttributeUnused() throws Exception { loadCodeAndRunC(getAboveComment()); checkNoErrors(); @@ -326,6 +333,18 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase { checkNoErrors(); } + // static void __attribute__((constructor)) Ctor() {} + // static void __attribute__((destructor)) Dtor(); + // static void Dtor2() __attribute__((destructor)); + // static void Dtor3() __attribute__((destructor)); + // static void Dtor() {} + // static void Dtor2() {} + // void Dtor3() {} + public void testAttributeConstructorDestructor_bug389577() throws Exception { + loadCodeAndRun(getAboveComment()); + checkNoErrors(); + } + // extern int* pxCurrentTCB; // // int main() { |