Re: Fwd: util_expr_parce.c

2011-01-18 Thread Gregg L\. Smith
Sorry if this breaks thread, had to subscribe a new address
 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

Hi Stefan,

Thank you and yes that probably is not a good idea after all, I was unaware of 
that connection. Your suggestion does work, that removes the linkage warnings.

Yes _MSC_VER is correct, the compilers do define that and our header file 
defines;

#ifndef _INC_STDLIB
#define _INC_STDLIB

Thanks again,

Gregg





Re: Fwd: util_expr_parce.c

2011-01-18 Thread Stefan Fritsch

On Tue, 18 Jan 2011, Gregg L\. Smith wrote:
Thank you and yes that probably is not a good idea after all, I was 
unaware of that connection. Your suggestion does work, that removes the 
linkage warnings.


Thanks for testing. Commited as r1060588



Yes _MSC_VER is correct, the compilers do define that and our header file 
defines;

#ifndef _INC_STDLIB
#define _INC_STDLIB


It seems bison wrongly assumes that stdlib.h always uses _STDLIB_H.


Re: Fwd: util_expr_parce.c

2011-01-16 Thread Stefan Fritsch
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


Fwd: util_expr_parce.c

2011-01-14 Thread Guenter Knauf
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