Open tstreiff opened 4 years ago
I am writing a fix for this issue.
I am fighting with the notion of "constant expression" (which appears at several places in the C grammar). It looks as if "parse_constant_expression()" does not ensure that the expression is really constant and it returns the found expression unchanged. I haven't found any easy way to compute the value of an expression such as 2+3 or even -1 in the parsing/semantics pass. Did I miss something obvious?
All switch/case contraints are not tested by the front-end, and this makes the code generator crash or generate wrong code:
Side remarks The compiler ensures that no case value is duplicated, but this is done in the IR code generator, it seems more logical to do this during the semantics checking.
In nodes/types.py some type predicates are a bit confusing because they do not follow the C standards: