httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Galić <i.ga...@brainsware.org>
Subject Re: Apache alpha and mod_jk
Date Fri, 15 Oct 2010 16:12:04 GMT

----- "Rainer Jung" <rainer.jung@kippdata.de> wrote:

> Igor,
> 
> thanks for checking as well. The Op also posted to the Tomcat dev list
> 
> and I applied a change to mod_jk a few minutes ago which at least lets
> 
> it compile for 2.0/2.2/2.3.

It does indeed compile. I haven't tested it yet myself.
(I usually use mod_proxy_ajp|http)

> The culprit was the usual, we do use APLOG_MARK in other places than 
> just ap_log* and since the macro changed its meaning the code broke. 
> That's expected and well-documented after adding the per-module log 
> config to 2.3.

I remembered that it was documented and was looking for documentation
but failed to find it.

> The change is
> 
> http://svn.apache.org/viewvc?view=revision&revision=1022975

This patch now throws 4 warnings alltogether:



I'm getting:

/opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang -I/opt/bw/include -fPIC -msse4.1
-D_FORTIFY_SOURCE=2 -fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall -Wm
issing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread -DHAVE_APR  -I/opt/bw/include
-fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_
DEBUG -I /include -I /include/ -c jk_map.c -o jk_map.lo
jk_map.c:637:24: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
    for (i = i - 1; (i >= 0) &&
                     ~ ^  ~
1 warning generated.


And, this, which can be ignored, I suppose:

/opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang -I/opt/bw/include -fPIC -msse4.1
-D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5 -I ../common -I /include -I /include/unix -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2 -msse4.1 -D_FORTIFY_SOURCE=2
-g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes
-Wstrict-prototypes -Wmissing-declarations -pthread -DLINUX=2 -D_REENTRANT -D_GNU_
SOURCE -DAP_DEBUG -c mod_jk.c -o mod_jk.lo
mod_jk.c:647:5: warning: initializing 'server_rec *' (aka 'struct server_rec *') with an expression
of type 'const server_rec *' (aka 'const struct server_rec *') discards
      qualifiers
    ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
                          ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
    do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))      \
                     ^
mod_jk.c:647:5: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
                          ^
mod_jk.c:647:5: note: instantiated from:
    ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
    ^                                                         ~~~
mod_jk.c:647:63: note: instantiated from:
    ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
                                                              ^~~
mod_jk.c:653:9: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
                          ^
mod_jk.c:653:9: note: instantiated from:
        ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
        ^                                                            ~~~
mod_jk.c:653:70: note: instantiated from:
        ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
                                                                     ^~~
3 warnings generated.






> and I already answered the other post on the Tomcat dev list.
> 
> I didn't yet actually test the resulting code.
> 
> Regards,
> 
> Rainer
> 
> On 15.10.2010 17:50, Igor Galić wrote:
> >> I'll report back in a bit
> >
> > compiling mod_jk trunk against httpd trunk (with clang from trunk):
> >
> > It all looks like good clean fun, until it hits the new logging
> API:
> >
> > opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang
> -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5
> -I ../common -I /include -I /include/unix -
> > DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2
> -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes
> -Wstrict-prototypes -Wmissing-declarations -pthread
> > -DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -g
> -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
> -pthread -DLINUX=2 -D_REENTRANT -D_GNU_
> > SOURCE -DAP_DEBUG -c mod_jk.c -o mod_jk.lo
> > mod_jk.c:639:5: warning: incompatible pointer types initializing
> 'server_rec *' (aka 'struct server_rec *') with an expression of type
> 'char *'
> >      ap_log_error(file, line, level, 0, s, res);
> >      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from mod_jk.c:40:
> > /opt/bw/include/http_log.h:337:27: note: instantiated from:
> > #define ap_log_error(...) ap_log_error__(__VA_ARGS__)
> >                            ^
> > /opt/bw/include/http_log.h:340:22: note: instantiated from:
> >      do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi,
> level))      \
> >                       ^
> > mod_jk.c:639:5: error: expected expression
> >      ap_log_error(file, line, level, 0, s, res);
> >      ^
> > In file included from mod_jk.c:40:
> > /opt/bw/include/http_log.h:337:27: note: instantiated from:
> > #define ap_log_error(...) ap_log_error__(__VA_ARGS__)
> >                            ^
> > /opt/bw/include/http_log.h:341:74: note: instantiated from:
> >               ap_log_error_(file, line, mi, level, status, sr,
> __VA_ARGS__); \
> >                                                                     
>      ^
> > mod_jk.c:641:9: warning: incompatible pointer types initializing
> 'server_rec *' (aka 'struct server_rec *') with an expression of type
> 'char *'
> >          ap_log_error(file, line, level, 0, NULL, res);
> >          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from mod_jk.c:40:
> > /opt/bw/include/http_log.h:337:27: note: instantiated from:
> > #define ap_log_error(...) ap_log_error__(__VA_ARGS__)
> >                            ^
> > /opt/bw/include/http_log.h:340:22: note: instantiated from:
> >      do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi,
> level))      \
> >                       ^
> > mod_jk.c:641:9: error: expected expression
> >          ap_log_error(file, line, level, 0, NULL, res);
> >          ^
> > In file included from mod_jk.c:40:
> > /opt/bw/include/http_log.h:337:27: note: instantiated from:
> > #define ap_log_error(...) ap_log_error__(__VA_ARGS__)
> >                            ^
> > /opt/bw/include/http_log.h:341:74: note: instantiated from:
> >               ap_log_error_(file, line, mi, level, status, sr,
> __VA_ARGS__); \
> >                                                                     
>      ^
> > mod_jk.c:2829:56: warning: incompatible pointer types passing
> 'server_rec *' (aka 'struct server_rec *') to parameter of type
> 'apr_pool_t *' (aka 'struct apr_pool_t *')
> >                  jk_error_exit(APLOG_MARK, APLOG_EMERG,
> overrides->s, p, "Memory error");
> >                                                        
> ^~~~~~~~~~~~
> > mod_jk.c:620:40: note: passing argument to parameter 'p' here
> >                            apr_pool_t * p, const char *fmt, ...)
> >                                         ^
> > mod_jk.c:2829:70: warning: incompatible pointer types passing
> 'apr_pool_t *' (aka 'struct apr_pool_t *') to parameter of type 'const
> char *'
> >                  jk_error_exit(APLOG_MARK, APLOG_EMERG,
> overrides->s, p, "Memory error");
> >                                                                     
>  ^
> > mod_jk.c:620:55: note: passing argument to parameter 'fmt' here
> >                            apr_pool_t * p, const char *fmt, ...)
> >                                                        ^
> > mod_jk.c:3272:68: warning: incompatible pointer types passing
> 'server_rec *' (aka 'struct server_rec *') to parameter of type
> 'apr_pool_t *' (aka 'struct apr_pool_t *')
> >                              jk_error_exit(APLOG_MARK, APLOG_EMERG,
> srv,
> >                                                                    
> ^~~
> > mod_jk.c:620:40: note: passing argument to parameter 'p' here
> >                            apr_pool_t * p, const char *fmt, ...)
> >                                         ^
> > mod_jk.c:3273:43: warning: incompatible pointer types passing
> 'apr_pool_t *' (aka 'struct apr_pool_t *') to parameter of type 'const
> char *'
> >                                            srv->process->pool,
> "Memory error");
> >                                            ^~~~~~~~~~~~~~~~~~
> > mod_jk.c:620:55: note: passing argument to parameter 'fmt' here
> >                            apr_pool_t * p, const char *fmt, ...)
> >                                                        ^
> > 6 warnings and 2 errors generated.
> > make[1]: *** [mod_jk.lo] Error 1
> > make[1]: Leaving directory
> `/home/i.galic/Projects/asf/mod_jk/native/apache-2.0'
> > make: *** [all-recursive] Error 1
> >
> >
> > I managed to get it to compile... But I won't share the diff here,
> > so as not to cause sudden shortage of breath, severe head-aches
> > and other kinds of unforeseen accidents.
> >
> > i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

Mime
View raw message