michaelrsweet/mxml

warning: implicit declaration of vasprintf

aganm opened this issue · 3 comments

aganm commented

gcc gives me this warning
mxml-string.c:98:7: warning: implicit declaration of function 'vasprintf'

Any idea how to get rid of it?

aganm commented

I found how to fix this.

In config.h, you have to add the line #define _GNU_SOURCE before including stdio.h.
As such

/*
 * Include necessary headers...
 */

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>

@aganm This define is already added by the configure script to CFLAGS. How are you building Mini-XML?

aganm commented

Ah thanks! I am building it by including the source in my project, I will eventually change it to build as static library.