You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Guenter Knauf <fu...@apache.org> on 2011/01/15 03:05:17 UTC

Fwd: util_expr_parce.c

Forwarded on behalf of Gregg L. Smith (his email bounced 3 times for 
whatever reason).

-------- Original-Nachricht --------

Hi Stefan,

For some reason on Win we are falling through all the if(n)defs and are 
getting these ugly warnings;

util_expr_parse.c(327) : warning C4273: 'malloc' : inconsistent dll linkage
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(601) : 
see previous definition of 'malloc'
util_expr_parse.c(334) : warning C4273: 'free' : inconsistent dll linkage
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(600) : 
see previous definition of 'free'

stdlib is being included in httpd.h since APR_HAVE_STDLIB_H == 1 in Win.

May I suggest looking for it in util_expr_private.h and define _STDLIB_H 
there or any where/way you prefer.

#if APR_HAVE_STDLIB_H
#define _STDLIB_H
#endif

That rids us of the two ugliest warnings emitted from this parser.

Regards,

Gregg



Re: Fwd: util_expr_parce.c

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Saturday 15 January 2011, Guenter Knauf wrote:
> Forwarded on behalf of Gregg L. Smith (his email bounced 3 times
> for whatever reason).
> 
> -------- Original-Nachricht --------
> 
> Hi Stefan,
> 
> For some reason on Win we are falling through all the if(n)defs and
> are getting these ugly warnings;
> 
> util_expr_parse.c(327) : warning C4273: 'malloc' : inconsistent dll
> linkage C:\Program Files\Microsoft Visual Studio
> 9.0\VC\include\stdlib.h(601) : see previous definition of 'malloc'
> util_expr_parse.c(334) : warning C4273: 'free' : inconsistent dll
> linkage C:\Program Files\Microsoft Visual Studio
> 9.0\VC\include\stdlib.h(600) : see previous definition of 'free'
> 
> stdlib is being included in httpd.h since APR_HAVE_STDLIB_H == 1 in
> Win.
> 
> May I suggest looking for it in util_expr_private.h and define
> _STDLIB_H there or any where/way you prefer.
> 
> #if APR_HAVE_STDLIB_H
> #define _STDLIB_H
> #endif
> 
> That rids us of the two ugliest warnings emitted from this parser.

That is an extremely ugly solution: stdlib.h uses "#ifndef _STDLIB_H" 
internally, so this may negatively affect other plattforms or other 
source files which include util_expr_private.h.

From reading util_expr_parse.c, I think something like

#define YYMALLOC malloc
#define YYFREE   free

in util_expr_private.h could help. Please test this. Maybe it should 
be surrounded by some suitable ifdef. Is _MSC_VER the correct ifdef 
for visual studio?

Cheers,
Stefan