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

Build Issue "note: include ‘<stdlib.h>’ or provide a declaration of ..." #872

Closed
acbk2b opened this issue May 19, 2024 · 2 comments
Closed

Comments

@acbk2b
Copy link

acbk2b commented May 19, 2024

Hello all,

I am building sc-im 0.8.3-2 on Arch Linux.
I have tried with the AUR package, but running make in the project as detailed in the README's installation instructions yields the same result.
There are comments on the AUR comments page for the same error, thus I believe this may be a common issue.
When I run make -C src, I get several errors related to ods.c, like the below:

formats/ods.c:97:28: error: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
   97 |         content = (char *) malloc(sb_content.size);
      |                            ^~~~~~
formats/ods.c:58:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
   57 | #include "../utils/string.h"
  +++ |+#include <stdlib.h>
   58 | #endif
formats/ods.c:97:28: warning: incompatible implicit declaration of built-in function ‘malloc’ [-Wbuiltin-declaration-mismatch]
   97 |         content = (char *) malloc(sb_content.size);
      |                            ^~~~~~
formats/ods.c:97:28: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’

I also receive the same error for calls to atof.
The fix for this issue was simply adding #include <stdlib.h> in src/formats/ods.c.
I am not very familiar with C build systems, so I am not certain whether this has any other impacts.
If this is an acceptable fix, I am more than happy to open a Pull Request for this, and if not I would appreciate some help in figuring out another solution.

Let me know if you need anything else from my end
Thanks!

@andmarti1424
Copy link
Owner

Yes please check pr 871.will merge it soon.

@acbk2b
Copy link
Author

acbk2b commented May 19, 2024

Awesome, I did not see that.
Thanks for the update!

@acbk2b acbk2b closed this as completed May 19, 2024
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