bug-cvs
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Re: const qualifier violation in regex.c:re_comp()


From: Derek Robert Price
Subject: Re: [Bug-gnulib] Re: const qualifier violation in regex.c:re_comp()
Date: Tue, 05 Oct 2004 12:14:37 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

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

Bruno Haible wrote:

>>There is another change to regex.c that was reported against regex.c
>>that might be well to fix in the GNULIB version.
>>
>>Index: lib/regex.c
>>===================================================================
>>RCS file: /cvsroot/gnulib/gnulib/lib/regex.c,v
>>retrieving revision 1.84
>>diff -u -p -r1.84 regex.c
>>--- lib/regex.c    4 Oct 2004 21:00:42 -0000    1.84
>>+++ lib/regex.c    5 Oct 2004 14:57:42 -0000
>>@@ -4970,7 +4970,7 @@ weak_alias (__re_search_2, re_search_2)
>> #ifdef INSIDE_RECURSION
>>
>> #ifdef MATCH_MAY_ALLOCATE
>>-# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
>>+# define FREE_VAR(var) if (var) (void)REGEX_FREE ((void *)var); var
= NULL
>> #else
>> # define FREE_VAR(var) if (var) free (var); var = NULL
>> #endif
>
>
>I vote against such changes because
>
>  1) MSVC emits warnings for many constructs which are perfectly valid C
>     and don't indicate a bug in most cases (such as passing a 'short'
>     value as argument to a function which expects an 'int', or vice
versa),
>
>  2) The GNU standards say on this topic: "The compiler should be
your servant,
>     not your master."
>
>GCC's -Wall produces a reasonable set of warnings, MSVC -W2 or -W3
doesn't.
>
>Bruno


I agree with Bruno here.  Not sure what Conrad was trying to suppress
here, but "free ((void *)var)", especially, seems most likely to
supress useful warnings from `gcc -Wall'.

Cheers,

Derek

- --
                *8^)

Email: address@hidden

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

iD8DBQFBYshsLD1OTBfyMaQRAqM2AJ96o3MAuZfIYJEQ3JjxLBNnWVakVwCfepOK
ueMll37j+TtPeXpe9BIht00=
=LOg+
-----END PGP SIGNATURE-----





reply via email to

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