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: Derek Robert Price
Subject: Re: Windows Build: lib/regex.c warnings, "free" calls
Date: Mon, 05 Apr 2004 12:09:43 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Conrad T. Pino wrote:

>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))


This is acceptable only if every call to REGEX_FREE is generating the
warning.  Otherwise, the specific offensive calls should be cast
individually.

Also, this will probably be the correct fix on stable but somebody
should see about updating the version on feature from GNULIB and then
sending any changes that need to be made to supress warnings back to the
GNULIB maintainers.  See HACKING & srclist.txt for more.  Last time I
looked, there were two version of the regex module in GNULIB, one from
Emacs & one from, um, glibc, maybe.  They're working on merging them but
last time I check they hadn't finished (they have made some progress -
there used to be 3 versions).  Probably the easiest way to update regex
is to try and figure out which version the GNULIB folks are trying to
head for, then just install it in CVS and see if the sanity.sh tests
pass.  If not try the other one.  If neither works, then more
investigation would be necessary, I am sure...

Derek

- --
                *8^)

Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org

iD8DBQFAcYTGLD1OTBfyMaQRAt3KAJ9gAJa5ksSE1rGXElA5/4autj8xTACg65Fb
vLTmQvhcqj8Dg1ry5kfebJU=
=sp8L
-----END PGP SIGNATURE-----






reply via email to

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