Index of /bits/mod_sqlinclude
Name Last modified Size Description
Parent Directory -
mod_sqlinclude-for-apache2_v1.diff 21-Jun-2006 04:28 21K
mod_sqlinclude2.c.diff 21-Jun-2006 04:28 3.3K
- Josh, i made some alterations to your mod_sqlinclude.c (and renamed it to mod_sqlinclude2.c)
to avoid some of the following warnings:
------------------------
apxs2 -n sqlinclude -c -lmysqlclient mod_sqlinclude2.c
/usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread -I/usr/include/apache2 -I/usr/include/apr-0 -I/usr/include/apr-0 -I/usr/include -c -o mod_sqlinclude2.lo mod_sqlinclude2.c && touch mod_sqlinclude2.slo
mod_sqlinclude2.c: In function 'ProcessEntry':
mod_sqlinclude2.c:154: warning: format '%ld' expects type 'long int', but argument 4 has type 'int'
mod_sqlinclude2.c:154: warning: format '%ld' expects type 'long int', but argument 4 has type 'int'
mod_sqlinclude2.c:161: warning: format '%ld' expects type 'long int', but argument 8 has type 'int'
mod_sqlinclude2.c: In function 'cmd_sqli_include':
mod_sqlinclude2.c:247: warning: format '%ld' expects type 'long int', but argument 10 has type 'int'
mod_sqlinclude2.c:271: warning: format '%ld' expects type 'long int', but argument 9 has type 'int'
mod_sqlinclude2.c:272: warning: implicit declaration of function 'sleep'
mod_sqlinclude2.c:295: warning: format '%ld' expects type 'long int', but argument 8 has type 'int'
mod_sqlinclude2.c:299: warning: suggest parentheses around assignment used as truth value
mod_sqlinclude2.c:227: warning: unused variable 'len'
mod_sqlinclude2.c:227: warning: unused variable 'err'
mod_sqlinclude2.c:226: warning: unused variable 'buf'
/usr/bin/libtool --silent --mode=link gcc -o mod_sqlinclude2.la -lmysqlclient -rpath /usr/lib/apache2/modules -module -avoid-version mod_sqlinclude2.lo
------------------------
- should "num" and "i" be of type "int" or "long int"? i've chosen long int for now, otherwise we'd change "%ld" to "%d"? (uuh, don't beat me...)
- i've removed the unused variables.
- line 299 is quite interesting, at least for me: is "while( row = mysql_fetch_row(result))" a comparison or an assignment?
if it is a comparison, we'd have to initialize "row"
- with mod_sqlinclude2.c.diff applied (applies to your mod_sqlinclude.c), i still get these warnings. yes, warnings only, it compiles and loads
fine. i just have to hammer it a bit to see if it's stable as mod_sqlinclude for apache1 ;-)
------------------------
apxs2 -n sqlinclude -c -lmysqlclient mod_sqlinclude2.c
/usr/bin/libtool --silent --mode=compile gcc -prefer-pic -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -g -O2 -pthread -I/usr/include/apache2 -I/usr/include/apr-0 -I/usr/include/apr-0 -I/usr/include -c -o mod_sqlinclude2.lo mod_sqlinclude2.c && touch mod_sqlinclude2.slo
mod_sqlinclude2.c: In function 'ProcessEntry':
mod_sqlinclude2.c:188: warning: format '%ld' expects type 'long int', but argument 10 has type 'unsigned int'
mod_sqlinclude2.c:203: warning: format '%ld' expects type 'long int', but argument 10 has type 'unsigned int'
mod_sqlinclude2.c: In function 'cmd_sqli_include':
mod_sqlinclude2.c:245: warning: format '%ld' expects type 'long int', but argument 10 has type 'int'
mod_sqlinclude2.c:270: warning: implicit declaration of function 'sleep'
mod_sqlinclude2.c:299: warning: 'row' is used uninitialized in this function
/usr/bin/libtool --silent --mode=link gcc -o mod_sqlinclude2.la -lmysqlclient -rpath /usr/lib/apache2/modules -module -avoid-version mod_sqlinclude2.lo
------------------------
(this is Apache/2.0.55, gcc (GCC) 4.0.3 20051111 (prerelease) (Debian 4.0.2-4))