You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryan Deemer <ry...@gmail.com> on 2009/03/19 22:02:32 UTC

change in AP_INIT_TAKE1

Hi all,

I am porting my custom module from apache 2.0 module to 2.2.11 using
gcc-3.4.6 and  get the following warning in the usage of AP_INIT_TAKE1.

mod_reversal.c:786: warning: initialization from incompatible pointer type

I see that it is discussed previously, but I couldnt find any specific
solution. to the problem.

http://objectmix.com/apache/692158-problems-starting-apache-2-2-mod_ruby-2.html
http://tp.its.yale.edu/pipermail/cas/2005-September/001575.html
http://www.nabble.com/www-apache20-on-6.0-S-td1362222.html

I see that in http_config.h checks if the compiler is C99 and an appropriate
definition is chosen, I tried several combinations with setting and
unsetting AP_HAVE_DESIGNATED_INITIALIZER but that didnt help.

Thanks in advance.

Ryan

Re: change in AP_INIT_TAKE1

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Mar 20, 2009 at 2:04 PM, Ryan Deemer <ry...@gmail.com> wrote:

> Hi guys,
>
> Anybody come across this before?


dunno

are you sure the types of the arguments to AP_INIT_TAKEx are correct?

If you build httpd yourself, did the compilation of the bundled modules spew
the same warnings?

(Or try building a few with apxs.)

Re: change in AP_INIT_TAKE1

Posted by Ryan Deemer <ry...@gmail.com>.
Hi guys,

Anybody come across this before?

Thanks
Ryan.

On Thu, Mar 19, 2009 at 5:02 PM, Ryan Deemer <ry...@gmail.com> wrote:
Hi all,

I am porting my custom module from apache 2.0 module to 2.2.11 using
gcc-3.4.6 and  get the following warning in the usage of AP_INIT_TAKE1.

mod_reversal.c:786: warning: initialization from incompatible pointer type

I see that it is discussed previously, but I couldnt find any specific
solution. to the problem.

http://objectmix.com/apache/692158-problems-starting-apache-2-2-mod_ruby-2.html
http://tp.its.yale.edu/pipermail/cas/2005-September/001575.html
http://www.nabble.com/www-apache20-on-6.0-S-td1362222.html

I see that in http_config.h checks if the compiler is C99 and an appropriate
definition is chosen, I tried several combinations with setting and
unsetting AP_HAVE_DESIGNATED_INITIALIZER but that didnt help.

Thanks in advance.

Ryan

Re: change in AP_INIT_TAKE1

Posted by Ryan Deemer <ry...@gmail.com>.
Hi all,

I am using the same compiler for both.

I traced the code of mod_ruby.c and saw the fix that they had done, and
doing the
same casting removed the warnings. I guess this happened because of the
change in the macro between 2.0 and 2.2.

Casted the second argument like this.

AP_INIT_TAKE1("Blue_Door", default_bluedoor_port, NULL, BD_CONF, "Default
BlueDoor Port"),

AP_INIT_TAKE1("Blue_Door", (const char *(*)())default_bluedoor_port, NULL,
BD_CONF, "Default BlueDoor Port"),

Comments welcome.

Thanks
Ryan.

On Fri, Mar 20, 2009 at 2:30 PM, Nick Kew <ni...@webthing.com> wrote:

> On Thu, 19 Mar 2009 17:02:32 -0400
> Ryan Deemer <ry...@gmail.com> wrote:
>
> > Hi all,
> >
> > I am porting my custom module from apache 2.0 module to 2.2.11 using
> > gcc-3.4.6 and  get the following warning in the usage of
> > AP_INIT_TAKE1.
> >
> > mod_reversal.c:786: warning: initialization from incompatible pointer
> > type
>
> Could it be that you have different compiler flags, a stricter
> gcc version, or perhaps a different architecture (like 32 vs 64-bit
> compile)?
>
> If not, a code sample that demonstrates what you're talking
> about would help.
>
> --
> Nick Kew
>
> Application Development with Apache - the Apache Modules Book
> http://www.apachetutor.org/
>

Re: change in AP_INIT_TAKE1

Posted by Nick Kew <ni...@webthing.com>.
On Thu, 19 Mar 2009 17:02:32 -0400
Ryan Deemer <ry...@gmail.com> wrote:

> Hi all,
> 
> I am porting my custom module from apache 2.0 module to 2.2.11 using
> gcc-3.4.6 and  get the following warning in the usage of
> AP_INIT_TAKE1.
> 
> mod_reversal.c:786: warning: initialization from incompatible pointer
> type

Could it be that you have different compiler flags, a stricter
gcc version, or perhaps a different architecture (like 32 vs 64-bit
compile)?

If not, a code sample that demonstrates what you're talking
about would help.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/