Opened 9 years ago
Last modified 9 years ago
#9 closed defect
Unconstrained dtype return values are closed in unification — at Version 1
| Reported by: | Rob Schluntz | Owned by: | Rob Schluntz |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | dtype unify unification malloc return |
| Cc: |
Description (last modified by )
#include <stdlib>
int main() {
int * i;
i = malloc();
}
cfa test.c
CFA Version 1.0.0 (debug)
test.c:2 error: Types:
_2_DT -> instance of type _71_T (not function type)
_36_DT -> signed int
Non-types:
unbound type variable: _71_T in application Application of
Variable Expression: malloc: forall
T: sized incomplete type
function
returning
_retval_malloc: pointer to instance of type T (not function type)
The dtype T is only used as the return value of malloc, i.e., T does not occur in the parameter list or any type assertion (other than the pseudo-assertion "sized"), so by the time it is seen in the assignment call ?=?(&i, malloc()) T is a closed type variable and the unification of T and int* fails.
Note:
See TracTickets
for help on using tickets.