Open
Description
#include <stdlib_checked.h>
int *getarr(unsigned z) {
int *s = malloc(sizeof(int)*z);
return s;
}
produces the following when run with -alltypes -addcr
:
#include <stdlib_checked.h>
_Array_ptr<int> getarr(unsigned z) : count(z) {
_Array_ptr<int> s : count(z) = malloc<int>(sizeof(int)*z);
return s;
}
If I manually add the _Checked
annotation to the converted code, then it compiles properly with Checked C's clang (it gives a warning, but it gives the same warning without the _Checked
annotation added). Should we be considering this code a legitimate checked region?