Skip to content

checked-c-convert : Static modifier removed from function declaration when the function has any arguments #622

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
hasantouma opened this issue Jun 19, 2019 · 1 comment

Comments

@hasantouma
Copy link
Contributor

This is similar to #524, but I found it to be true even when there is no * type. I'll illustrate this issue with an example where the argument is of type int to show that it's not only related to pointers.

Note: the function foo() is there to show that the checked-c-convert does do something on the second example where bar() doesn't change at all.

Example where static is removed:

Original C code:

void foo(void *(*func_ptr) (void *)) {
}

static void bar(int x) {
}

int main() {

  return 0;
}

checked-c-convert output:

void foo(_Ptr<void* (void* )> func_ptr) {
}

void bar(int x) {
}

int main() {

  return 0;
}

Example where static is not removed:

Original C code:

void foo(void *(*func_ptr) (void *)) {
}

static void bar(void) {
}

int main() {

  return 0;
}

checked-c-convert output:

void foo(_Ptr<void* (void* )> func_ptr) {
}

static void bar(void) {
}

int main() {

  return 0;
}

This is also true when there are no arguments passed in to bar()

@dtarditi
Copy link
Member

dtarditi commented Sep 2, 2019

The convert tool has been mostly rewritten (see PR #642). Please reopen this issue if it still exists.

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