But now, as I'm recompiling a portable 3rd party library using generated makefiles, malloc is undefined if malloc.h is not explicitly added (which is not portable, so I had to patch the code)
Can somebody explain me why ?
Code: Select all
if psp-gcc -G0 -DHAVE_CONFIG_H -I. -I. -I.. -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CONFIG=1 -Wall -O3 -fomit-frame-pointer -I/usr/local
/pspdev/psp/sdk/include/libc -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CO
NFIG=1 -Wall -O3 -fomit-frame-pointer -MT word.o -MD -MP -MF ".deps/word.Tpo" \
-c -o word.o `test -f 'word.c' || echo './'`word.c; \
then mv -f ".deps/word.Tpo" ".deps/word.Po"; \
else rm -f ".deps/word.Tpo"; exit 1; \
fi
word.c: In function 'strsav':
word.c:83: warning: implicit declaration of function 'malloc'
word.c:83: warning: incompatible implicit declaration of built-in function 'malloc'
word.c: In function 'delete_word_list':
word.c:96: warning: implicit declaration of function 'free'
/bin/sh ../libtool --mode=link psp-gcc -G0 -I/usr/local/pspdev/psp/sdk/include/libc -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev
/psp/include -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CONFIG=1 -Wall -O3 -fomit-frame-pointer -L/usr/local/pspdev/psp/sdk/lib -lz -lc -lpsp
libc -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpsputility -lpspuser -lpspkernel -o as68 as68.o error.o expression.o opcode.o wo
rd.o
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "as68.h"