Skip to content

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