For starters, the plan on integrating the const changes was to pull them in,
but edit them to keep all the function prototypes identical. I don't want to
change any function prototypes in maint, for binary compatibility paranoia,
because it's likely that some people are compiling perl with a C++ compiler,
and it's possible that for some reason it's missing or they're disabling the
extern "C" wrapping, so changing to const would change the name mangling and
thereby cause link time errors.
On Mon, Sep 26, 2005 at 09:38:52AM +0100, Steve Hay wrote:
> Steve Hay wrote:
>
> >Unfortunately something seems to be amiss. The bcc smoke (Fri night)
> >and the gcc smoke (Sat night) both failed with rather unhelpful logs.
> >I will investigate to see what the problem is.
>
> This diff fixes the gcc build and removes 1 of 2 errors in the bcc build:
>
> ==== //depot/maint-5.8/perl/util.c#85 - c:\p5p\maintperl\util.c ====
> @@ -1470,7 +1470,7 @@
> #else /* WIN32 || NETWARE */
>
> void
> -Perl_my_setenv(pTHX_ const char *nam, char *val)
> +Perl_my_setenv(pTHX_ char *nam, char *val)
> {
> register char *envstr;
> const int nlen = strlen(nam);
>
> (This just makes the signature in the Win32 case consistent with the
> other cases on line 1399 and the prototype in proto.h. BCC and GCC
> regard the inconsistency as an error, but VC++ only warned about it!)
>
> BCC additionally regards an inconsistency in Perl_find_script() as an
> error (whereas GCC and VC++ only warn):
>
> Perl_find_script(pTHX_ char *scriptname, bool dosearch, char
> **search_ext, I32 flags)
> {
> ...
> const char *exts[] = { SEARCH_EXTS };
> const char **ext = search_ext ? search_ext : exts;
>
> In bleadperl, the search_ext argument is a const char **. Without the
> const qualifier BCC complains:
>
> Error E2354 ..\util.c 2761: Two operands must evaluate to the same type
> in function Perl_find_script
>
> So it looks like you just need to continue integrating more consting
> changes, and hopefully it'll all come out in the wash eventually.
The thing is I think I know I was close to integrating the changes, and this
isn't one that I've missed, but instead one that I've removed the const
in embed.fnc but not changed the corresponding platform specific code.
So I think what's left is now tweaking maint as necessary (keeping the non-
static functions in embed.fnc constant) to make things work, and then work
without warnings.
Evil, maybe, but I think the least of the evils available to me.
Nicholas Clark