Skip to content

Issue converting typedef pointers to checked types #409

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

Closed
mgrang opened this issue Jan 28, 2021 · 1 comment
Closed

Issue converting typedef pointers to checked types #409

mgrang opened this issue Jan 28, 2021 · 1 comment

Comments

@mgrang
Copy link

mgrang commented Jan 28, 2021

An issue with the 3C tool was reported on our checkedc-clang repo: checkedc#619. I am transferring the issue to the 3C team for investigation.

Following are the details of the issue:

I came across this issue when converting the icecast code.

The issue can be illustrated with this small example:

#ifndef foo
#define foo int
#endif

int main() {
  foo* a;

  return 0;
}

checked-c-convert produces this:

#ifndef foo
#define foo int
#endif

int main() {
  _Ptr<int>  aa;

  return 0;
}

Note the variable name change and the _Ptr<> change from foo to int

This is a more extensive example of the issue:

C code:

#ifndef foo
#define foo int
#endif

int main() {
  foo *a, *b, *c;

  return 0;
}

checked-c-convert output:

#ifndef foo
#define foo int
#endif

int main() {
  foo *a, *b, *c_Ptr<int> a;
_Ptr<int> b;
_Ptr<int> c;
;

  return 0;
}
@john-h-kastner
Copy link
Collaborator

fixed by #254

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

No branches or pull requests

2 participants