My understanding is that the const triggers some optimizations because the
compiler better understands how the variables are used.

I'm not sure what degree of a difference it makes, but I'm always a fan of
using const if it's appropriate.

Perhaps your effort is better spent modifying the extensions to not emit
warnings?

I would be concerned if there were compilation errors rather than warnings.

--
William Bartlett
College of Engineering | Cornell University '14
240-432-5189


On Wed, Oct 2, 2013 at 2:41 PM, Jakub Zelenka <bu...@php.net> wrote:

> Hi,
>
> I was wondering why stream API has been changed in this commit:
>
>
> https://github.com/php/php-src/commit/92d27ccb0574f901a107409a7fec92888fa2b82f
>
> Basically all char pointers have been constified. The thing is that this
> commit leads to compilation warning for many extensions.
>
> In my case I use php_stream_locate_url_wrapper and want to compile my
> extension (fann) without any warnings. Because this change is in master and
> not in 5.5-, I will have to add some ifdefs and cast it for 5.6+.
>
> The thing is that php_stream_locate_url_wrapper and other stream fuctions
> are often used for function parameters from zend_parse_parameters which are
> just char *. Then the values have to be casted.
>
> I understand that APIs should be improved  and sometimes changes are
> necessary but in this case I have to ask a question. Was this change worthy
> to compilation warnings for many extensions?
>
> If not would it be possible to revert it?
>
> Thanks
>
> Jakub
>

Reply via email to