Opened 8 years ago
Closed 8 years ago
#24 closed enhancement (fixed)
Non-compatible safety conversion (like C++), prevent void * to T *
| Reported by: | pabuhr | Owned by: | |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | |
| Cc: |
Description
forall( otype T ) T * realloc( T *ptr, size_t n ) {
return (T *)(void *)realloc( ptr, sizeof(T) );
}
int fred() {
int *i;
double *d;
// need to change CFA so that T *p = void *p disallowed
i = realloc( d, 2 );
}
Note:
See TracTickets
for help on using tickets.
I think this is one for the new resolver...
...of course, I haven't added generic/pointer types to the prototype yet.