Skip to content

-addcr missing _Checked annotation #486

Open
@mwhicks1

Description

@mwhicks1
#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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions