[Kamailio-Devel] Patch to include micro sec / source filename / source file line in logs

Aurelien Grimaud gstelzz at yahoo.fr
Wed Dec 10 11:11:43 CET 2008


Hi, here is an 'almost working' patch attached which modifies dprint.h 
for log.

I have a problem with the sprintf function from stdio.h

Without the include <stdio.h>, I have warnings
 > gcc -g -O9 -funroll-loops -Wcast-align -Wall -minline-all-stringops 
-falign-loops -ftree-vectorize -mtune=prescott -Wold-style-definition 
-Wmissing-field-initializers -Wredundant-decls    -DNAME='"kamailio"' 
-DVERSION='"1.5.0-dev16-notls"' -DARCH='"i386"' -DOS='"linux"' 
-DCOMPILER='"gcc 4.3.0"' -D__CPU_i386 -D__OS_linux -D__SMP_yes 
-DCFG_DIR='"/usr/local/etc/kamailio/"' -DPKG_MALLOC -DSHM_MMAP 
-DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES 
-DSTATISTICS -DCHANGEABLE_DEBUG_LEVEL -DF_MALLOC  
-DSVNREVISION='"2:5321M"'  -DFAST_LOCK -DADAPTIVE_WAIT 
-DADAPTIVE_WAIT_LOOPS=1024  -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN 
-DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL 
-DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT 
-c action.c -o action.o
 > In file included from parser/../ip_addr.h:47,
 >                  from parser/msg_parser.h:53,
 >                  from action.h:33,
 >                  from action.c:52:
 > parser/../dprint.h: In function 'dp_time'
 > parser/../dprint.h:174: warning: implicit declaration of function 
'sprintf'
 > parser/../dprint.h:174: warning: incompatible implicit declaration of 
built-in function 'sprintf'
 >


With <stdio.h>, build fails !
 >
 > gcc -g -O9 -funroll-loops -Wcast-align -Wall -minline-all-stringops 
-falign-loops -ftree-vectorize -mtune=prescott -Wold-style-definition 
-Wmissing-field-initializer
 > s -Wredundant-decls    -DNAME='"kamailio"' 
-DVERSION='"1.5.0-dev16-notls"' -DARCH='"i386"' -DOS='"linux"' 
-DCOMPILER='"gcc 4.3.0"' -D__CPU_i386 -D__OS_linux -D__SMP_
 > yes -DCFG_DIR='"/usr/local/etc/kamailio/"' -DPKG_MALLOC -DSHM_MMAP 
-DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES 
-DSTATISTICS -DCHANGEABLE_DEBUG
 > _LEVEL -DF_MALLOC  -DSVNREVISION='"2:5321M"'  -DFAST_LOCK 
-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024  -DHAVE_GETHOSTBYNAME2 
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DH
 > AVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H 
-DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -c io_wait.c -o 
io_wait.o
 > In file included from dprint.h:63,
 >                  from io_wait.h:87,
 >                  from io_wait.c:50:
 > /usr/include/stdio.h:293: error: expected declaration specifiers or 
'...' before '_IO_cookie_io_functions_t'


Any clue ?

Regards.
Aurelien


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dprint.h.logformat.patch
Url: http://lists.kamailio.org/pipermail/devel/attachments/20081210/3e46b3e9/attachment.txt 


More information about the Devel mailing list