Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should casting a char * to _Nt_array_ptr be allowed? #1155

Open
mgrang opened this issue Aug 12, 2021 · 0 comments
Open

Should casting a char * to _Nt_array_ptr be allowed? #1155

mgrang opened this issue Aug 12, 2021 · 0 comments

Comments

@mgrang
Copy link

mgrang commented Aug 12, 2021

Should we allow this type of code?

char *g(_Nt_array_ptr<char> p);

void f(_Nt_array_ptr<char> p) {
  p = (_Nt_array_ptr<char>) g(p);
}

There is no guarantee that the char * returned by the function g() actually contains a null-terminator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant