Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2011-06-27 22:01:24 -0400
committerAlena Laskavaia2011-06-27 22:04:01 -0400
commit5431dae21921e1d3773335c1b36e120209dadfd2 (patch)
tree4cb9a86b0ad89c326582d138b731ddfb3fa44b56 /codan/org.eclipse.cdt.codan.core.test
parent6b80326e1789315fc94f20aedf3e38b67f218a89 (diff)
downloadorg.eclipse.cdt-5431dae21921e1d3773335c1b36e120209dadfd2.tar.gz
org.eclipse.cdt-5431dae21921e1d3773335c1b36e120209dadfd2.tar.xz
org.eclipse.cdt-5431dae21921e1d3773335c1b36e120209dadfd2.zip
Bug 332283 - Parser gives warning if main does not return anything
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.test')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
index aba819266d..09ec9f408b 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
@@ -280,4 +280,13 @@ public class ReturnCheckerTest extends CheckerTestCase {
checkNoErrors();
}
+ // int main()
+ // {
+ // char c; // added so function body is non-empty
+ // // no error since return value in main is optional
+ // }
+ public void testMainFunction() {
+ loadCodeAndRunCpp(getAboveComment());
+ checkNoErrors();
+ }
} \ No newline at end of file

Back to the top