diff options
author | Michael Forney <mforney@mforney.org> | 2022-03-10 22:52:04 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2022-03-10 23:08:58 -0800 |
commit | 892cadc8e27a94c6eb794a4d706e0b0c5bd210d0 (patch) | |
tree | 95bc3c1b23131c6d55a8ff8f820989d409ef0146 /doc | |
parent | 995d5b48b15779b9561aef59e035e34ef5c56839 (diff) |
qbe: Only return 0 from main if it has type int
Though C11 5.1.2.2.1 says that main must have a return type of int,
we could still encounter a program which declares it as something
else. This is undefined behavior, but we should not produce invalid
QBE IL in this case.
Also, 5.1.2.2.3 specifies that the implicit return 0 should only
apply when main's return type is compatible with int.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions