[erlang-bugs] Implicit declaration of function erl_malloc in legacy erl_timeout, R14B02

Michael Santos <>
Fri Apr 8 14:10:15 CEST 2011

On Fri, Apr 08, 2011 at 12:26:59PM +0200, Alessandro Sivieri wrote:
> Hi all,
> I was trying to create Ubuntu packages for Erlang R14B02 in my private PPA,
> but the system failed to build them on 64bit architecture because of the
> following:
> [...]
> x86_64-linux-gnu-gcc -g -O2 -fno-strict-aliasing -DEI_64BIT -fPIC -Wall
> -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wnested-externs -Winline -fno-strict-aliasing -I. -I../include -Iconnect
> -Iencode -Idecode -Imisc -Iepmd -Iregistry -Ix86_64-pc-linux-gnu   -c
> legacy/erl_timeout.c -o /build/buildd/erlang-14.b.2-dfsg/lib/erl_interface/
> obj.st/x86_64-pc-linux-gnu/erl_timeout.o
> legacy/erl_timeout.c: In function 'timeout_setup':
> legacy/erl_timeout.c:77: warning: implicit declaration of function
> 'erl_malloc'
> legacy/erl_timeout.c:77: warning: nested extern declaration of 'erl_malloc'
> legacy/erl_timeout.c:77: warning: assignment makes pointer from integer
> without a cast
> Function `erl_malloc' implicitly converted to pointer at
> legacy/erl_timeout.c:77
> [...]
> (and other three identical instances)
> The PPA system considers this kind of errors as possibly fatal for 64bit
> architectures ("always on ia64", using their words). I thought that this was
> the right place to report it.

I think I broke this. Thanks for catching it! Does the attached patch
fix the error?

diff --git a/lib/erl_interface/src/legacy/erl_timeout.c b/lib/erl_interface/src/legacy/erl_timeout.c
index d9560ee..146a106 100644
--- a/lib/erl_interface/src/legacy/erl_timeout.c
+++ b/lib/erl_interface/src/legacy/erl_timeout.c
@@ -43,6 +43,7 @@
 # endif
+#include "erl_interface.h"
 #include "erl_timeout.h"
 typedef struct jmp_s {

More information about the erlang-bugs mailing list