[Asterisk-Dev] Bug in inline_api.h: #undef AST_API_MODULE

Brian Capouch brianc at palaver.net
Tue Jul 12 00:22:31 MST 2005


It's late; I've been pounding on the recent CVS build for a while.  Hope 
I'm not talking crazy here.

In building CVS-HEAD for the MIPSEL-based WRT, I got a failure tonight 
on my build:

make[2]: Leaving directory `/usr/src/buildroot/ipkg/asterisk-test/asterisk'
/usr/src/buildroot/ipkg//../build_mipsel/staging_dir/bin/mipsel-linux-uclibc-gcc 
  -o asterisk -Wl,-E  io.o sched.o logger.o frame.o loader.o config.o 
channel.o
translate.o file.o say.o pbx.o cli.o md5.o term.o ulaw.o alaw.o 
callerid.o fskmodem.o image.o app.o cdr.o tdd.o acl.o rtp.o manager.o 
asterisk.o dsp.o chanvars.o indications.o autoservice.o db.o privacy.o 
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o utils.o 
config_old.o plc.o jitterbuf.o dnsmgr.o devicestate.o ast_expr.a 
editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a -ldl -lpthread 
-lncurses -lm -lresolv   -Wl,-Bstatic -lssl -Wl,-Bdynamic
logger.o(.text+0x48c): In function `make_logchannel':
: undefined reference to `ast_copy_string'

Lots of these same errors, references to "ast_copy_string" but it can't 
be found.

I hardwired the function into utils.c, built again, and Asterisk built 
just fine.  So it seems that the logic to include it is broken.

If I'm reading the code correctly, the brokenness is in inline_api.h, 
where the penultimate line undefs AST_API_MODULE.

What's supposed to happen is that if LOW_MEMORY is defined, then we 
don't want the inline versions of the functions.  utils.c is supposed to 
"grab" them in that case, through its definition of AST_API_MODULE.

But since strings.h includes inline_api.h, and inline_api.h undefs 
AST_API_MODULE, then BOTH sides of the or in strings.h are false, and 
ast_copy_string is never included in utils.c.

Removing the #undef AST_API_MODULE in inline_api.h allowed the build to 
go forth.  Whether that is the right fix or not is not for me to decide :-)

B.



More information about the asterisk-dev mailing list