Subject: Re: Cross compiling on FreeBSD 5.0, malloc.h is deprecated
To: Aron Stansvik <>
From: Valeriy E. Ushakov <>
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:

#include <malloc.h>

#include <stdlib.h>

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
--                         |       Zu Grunde kommen            |       Ist zu Grunde gehen