Subject: Re: Cross compiling on FreeBSD 5.0, malloc.h is deprecated
To: Aron Stansvik <elvstone@home.se>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: current-users
Date: 10/28/2003 23:10:41
On Tue, Oct 28, 2003 at 20:35:17 +0100, Aron Stansvik wrote:

> And the only file that, from what I can tell (there might be more, but
> my compilation bails out), that's affected is:
> 
> src/usr.bin/lex/flexdef.h
> 
> which on line 40 defines the __STDC__ macro and on line 61 includes the
> deprecated header malloc.h. This gives a preprocessor error on my
> system:

Oh, it's only a warning on FreeBSD 4.x, so I never bothered...

I think this:

#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif

should be changed to only check/include malloc.h if STDC_HEADERS are
not defined.

Alternatively (as we don't run configure for lex), we can just
undefine HAVE_MALLOC_H in config.h

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen