summaryrefslogtreecommitdiff
path: root/miniany/cc.wg
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2021-10-30 20:54:23 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2021-10-30 20:54:23 +0200
commita75c766f80126525e8dfa525b32252ba38b17b26 (patch)
treee5fafd2060dfd7569ece353237dd65ef3f993b93 /miniany/cc.wg
parentdf1a8de0d0667f39b51cffa812dca780cc48bc14 (diff)
downloadcompilertests-a75c766f80126525e8dfa525b32252ba38b17b26.tar.gz
compilertests-a75c766f80126525e8dfa525b32252ba38b17b26.tar.bz2
cc: some proper checking of return types and some primitive check for missing or superflous return statements
Diffstat (limited to 'miniany/cc.wg')
-rw-r--r--miniany/cc.wg14
1 files changed, 10 insertions, 4 deletions
diff --git a/miniany/cc.wg b/miniany/cc.wg
index 352d664..09ac15d 100644
--- a/miniany/cc.wg
+++ b/miniany/cc.wg
@@ -30,13 +30,13 @@ WordGrinder dumpfile v3: this is a text file; diff me!
.clipboard.viewmode: 1
.clipboard.wordcount: 6
.documents.1.co: 6
-.documents.1.cp: 38
-.documents.1.cw: 8
+.documents.1.cp: 191
+.documents.1.cw: 21
.documents.1.margin: 0
.documents.1.name: "main"
.documents.1.sticky_selection: false
.documents.1.viewmode: 1
-.documents.1.wordcount: 2863
+.documents.1.wordcount: 2988
.fileformat: 8
.findtext: "Note"
.menu.accelerators.^@: "ZM"
@@ -141,7 +141,7 @@ WordGrinder dumpfile v3: this is a text file; diff me!
.menu.accelerators.ZU: "UP"
.menu.accelerators.ZWL: "^LEFT"
.menu.accelerators.ZWR: "^RIGHT"
-.name: "/home/abaumann/projects/compilertests/miniany/cc.wg"
+.name: "/media/sd/abaumann/projects/compilertests/miniany/cc.wg"
.replacetext: ""
.statusbar: true
.current: 1
@@ -334,6 +334,12 @@ H3 Dangling else
P Implementation status: no
P Reasoning:
LB Don't allow non-blocked if/else, just avoid then dangling else problem, it's uninteresting and in C not as bad as in PASCAL-like languages, as the block markers are just one character big.
+H3 Return statement
+P Implemention status: yes, but..
+P Reasoning:
+LB There are good reasons not to allow return everywhere in the code, see newest Oberon revisions allowing RETURN only at the end of the function declaration. There are benefits like easier detection whether the function returns a function, easier flow analysis (image returns in complicated if-else-statements). For now we allow it everywhere, but we should try hard not to use it in the middle of code blocks.
+LB There is an argument from the code correctness point of view as return in the middle of code makes the code hard to reason about (similar to too many if-else-statements)
+LB Error handling is really hard, for now we check only whether we see a return at all anywhere in the body.
H3 Register Allocation
P Implementation status: yes
P Reasoning: