[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 
-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 
 > 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 
 > 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 
 > 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 ?


-------------- 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