10000 Fix deprecated function declarations by thilinarmtb · Pull Request #1977 · symengine/symengine · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix deprecated function declarations #1977

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

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

thilinarmtb
Copy link
Member

No description provided.

@certik
Copy link
Contributor
certik commented Sep 27, 2023

@thilinarmtb what warning does this show? I thought the void argument is the deprecated way.

@thilinarmtb
Copy link
Member Author

@certik : Thanks for approving the changes. I got the following when I included symengine
in a project I compile with -Wall -Wextra -Wpedantic. I can reproduce it with the following
simple file:

thili@M2-Pro Misc % cat deprecated.c 
void foo() {}

int main(int argc, char **argv) {
  foo();
  return 0;
}
thili@M2-Pro Misc % gcc deprecated.c -Wall -Wextra -Wpedantic
deprecated.c:1:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void foo() {}
        ^
         void
deprecated.c:3:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char **argv) {
             ^
deprecated.c:3:27: warning: unused parameter 'argv' [-Wunused-parameter]
int main(int argc, char **argv) {
                          ^
3 warnings generated.

@thilinarmtb
Copy link
Member Author
thilinarmtb commented Sep 30, 2023

In C, I think use of foo(void) in the parameter list implies empty parameter list whereas foo()
declares a function that takes an unspecified number of fixed parameters based on this SO answer:
https://stackoverflow.com/a/5929736/1895353

@certik certik merged commit de9ad44 into symengine:master Sep 30, 2023
@certik
Copy link
Contributor
certik commented Sep 30, 2023

Thanks! I see, this only happens in the C wrappers. Thanks for the fix.

@thilinarmtb thilinarmtb deleted the fix-warnings branch October 1, 2023 03:04
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

Successfully merging this pull request may close these issues.

2 participants
0