bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Windows Build: lib/regex.c warnings, "free" calls


From: Conrad T. Pino
Subject: RE: Windows Build: lib/regex.c warnings, "free" calls
Date: Sun, 4 Apr 2004 19:01:02 -0700

Hi All,

> From: Conrad T. Pino
> 
> Option 2: Modify macros
> 
> In the file "FREE_VARIABLES" is a macro that invokes other macros that
> resolve to calls to "free".  The final macros can be modified to include
> a (void *) cast that would suppress the warnings but only for the specific
> cases where we don't want the warnings.

Option 2 looks like a 1 line change with 2 possible candidates:

Index: lib/regex.c
===================================================================
RCS file: /cvs/ccvs/lib/regex.c,v
retrieving revision 1.12
diff -u -p -r1.12 regex.c
--- lib/regex.c 8 Aug 2002 19:55:42 -0000       1.12
+++ lib/regex.c 5 Apr 2004 01:43:34 -0000
@@ -263,7 +263,7 @@ init_syntax_once ()
 
 #define REGEX_ALLOCATE malloc
 #define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
-#define REGEX_FREE free
+#define REGEX_FREE(arg) free ((void *) (arg))
 
 #else /* not REGEX_MALLOC  */
Index: lib/regex.c
===================================================================
RCS file: /cvs/ccvs/lib/regex.c,v
retrieving revision 1.12
diff -u -p -r1.12 regex.c
--- lib/regex.c 8 Aug 2002 19:55:42 -0000       1.12
+++ lib/regex.c 5 Apr 2004 01:57:42 -0000
@@ -4001,7 +4001,7 @@ static boolean alt_match_null_string_p (
 
 /* Free everything we malloc.  */
 #ifdef MATCH_MAY_ALLOCATE
-#define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else
+#define FREE_VAR(var) if (var) { REGEX_FREE ((void *) (var)); var = NULL; } 
else
 #define FREE_VARIABLES()                                               \
   do {                                                                 \
     REGEX_FREE_STACK (fail_stack.stack);                               \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]