httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: Fwd: util_expr_parce.c
Date Sun, 16 Jan 2011 21:55:05 GMT
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

Mime
View raw message