Skip to content

Commit

Permalink
xml_utils: explicitly include <stdlib.h>
Browse files Browse the repository at this point in the history
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 <nuno.sa@analog.com>
  • Loading branch information
nunojsa authored and mhennerich committed Nov 29, 2023
1 parent 5b55c04 commit 1925e45
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xml_utils.c
Expand Up @@ -7,6 +7,7 @@

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
#include <libxml/xmlmemory.h>
Expand Down

0 comments on commit 1925e45

Please sign in to comment.