In article <[EMAIL PROTECTED]> you write:
>Hello,
>I'm trying to compile Apache 1.2.5 with the module mod_block.c off of
>Apache's web site http://www.apache.org/dist/contrib/modules/mod_block.c
>When I run make, I get the following error.
>
>gcc -c -Iregex   -DLINUX=2 -DSTATUS   mod_block.c
>mod_block.c:109: warning: initialization from incompatible pointer type
>
>So I'm guessing its something out of the following block of code, but what?
> I'm still learning.
>Thanks, David
>
>char *add_referer_block (cmd_parms *parms, void *dummy, char *arg)
>{
>    block_state *cls = get_module_config
>(parms->server->module_config,&block_module);
>    table_set(cls->block_referer_list, arg, arg);
>    return NULL;
>}
>
>command_rec block_cmds[] = {
>{ "BlockReferer", add_referer_block, NULL, RSRC_CONF, ITERATE,"referer
>hostnames to block" },
>{ NULL }
>};

The "func" element of command_rec is of type "pointer to function
returning const char *.  add_referer_block is a function returning
char *.  They don't match - hence the error.

To correct it, simply add "const" on the front of add_referer_block
like this:

const char *add_referer_block (cmd_parms *parms, void *dummy, char *arg)

HTH
John
-- 
John Winters.  Wallingford, Oxon, England.

The Linux Emporium - a source for Linux CDs in the UK
See <http://www.polo.demon.co.uk/emporium.html>


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to