apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] apr_hash_this_{key,klen,val}
Date Fri, 12 Mar 2010 21:03:03 GMT
On 3/12/2010 1:39 PM, Greg Stein wrote:
> Of course not. I have NO IDEA what the hell you're talking about. Why
> would you even attempt to assign an "int" function return to a "char
> *" variable? And that function is declared to take a parameter which
> you didn't give it. It's just nonsense code.

Code written in the absence of sufficient caffeine, yes, sorry about that.
The illustration that I believed wouldn't compile should have been...

int oldfunc (const char ** result);

int brokefunc ()
    char *res;

    int i = oldfunc(&res);

As you say, this does compile, I wrongly anticipated the side effects
of adding this constness change.  It says res may be modified, but that
the data res pointed to is not volatile.  I thought this further suggested
that the data returned via *result remained const, but I was wrong.

But APR assures forward and backwards source compatibility within 1.x.
So anyone coding correctly for constness in 1.5 will discover their source
code is broken against 1.4.2.  Doesn't this violate the versioning contract?

View raw message