azynheira / mu0

Automatically exported from code.google.com/p/mu0
0 stars 0 forks source link

alloca problems #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Compiling mu-0.4 on NetBSD-5.99.3/amd64, I get compilation errors because
various files include <alloca.h> for the alloca() prototype.
On NetBSD, that is included in <stdlib.h> and <alloca.h> doesn't exist.
The man pages both on Linux and NetBSD claim that alloca is machine
dependent and its use discouraged.

Quick fix: check for the existence of alloca.h in the configure script and
only include it, if it's available.
Proper fix: get rid of alloca() :)

Original issue reported on code.google.com by tk@giga.or.at on 9 Dec 2008 at 5:47

GoogleCodeExporter commented 8 years ago
well, i use alloca for optimization purposes, i think it's withing the bounds 
of what
the manpage notes.

anyway, i'll move to g_alloca (in glib.h) instead for 0.5, which should get rid 
of
the #include probs.

Original comment by digg...@gmail.com on 9 Dec 2008 at 11:18

GoogleCodeExporter commented 8 years ago
Using g_alloca is a good solution, thanks.

Original comment by tk@giga.or.at on 9 Dec 2008 at 11:45

GoogleCodeExporter commented 8 years ago
this will be fixed in the upcoming version.

Original comment by digg...@gmail.com on 8 Dec 2009 at 5:25