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

xml_utils: explicitly include <stdlib.h> #465

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

nunojsa
Copy link
Contributor

@nunojsa nunojsa commented Nov 28, 2023

Building osc in arch linux started to fail because of warnings being treated as errors:

"
error: implicit declaration of function ‘calloc’ [-Werror=implicit-function-declaration]
188 | text = (char )calloc(1, sizeof(char)); / Create an empty string */
| ^~~~~~
note: include ‘<stdlib.h>’ or provide a declaration of ‘calloc’
error: incompatible implicit declaration of built-in function ‘calloc’ [-Werror=builtin-declaration-mismatch]
"

The likely reason is that stdlib.h was somehow being indirectly included and maybe a change in libxml changed that. Hence, let's just explicitly include the needed header.

Building osc in arch linux started to fail because of warnings being
treated as errors:

"
error: implicit declaration of function ‘calloc’ [-Werror=implicit-function-declaration]
  188 |                 text = (char *)calloc(1, sizeof(char)); /* Create an empty string */
      |                                ^~~~~~
note: include ‘<stdlib.h>’ or provide a declaration of ‘calloc’
error: incompatible implicit declaration of built-in function ‘calloc’ [-Werror=builtin-declaration-mismatch]
"

The likely reason is that stdlib.h was somehow being indirectly included
and maybe a change in libxml changed that. Hence, let's just explicitly
include the needed header.

Signed-off-by: Nuno Sa <[email protected]>
@nunojsa nunojsa requested review from dNechita and a team November 28, 2023 15:43
@mhennerich mhennerich merged commit 1925e45 into master Nov 29, 2023
10 checks passed
@mhennerich mhennerich deleted the fix/osc-arch-compilation branch November 29, 2023 08:59
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.

3 participants