On Wed, 6 May 2020 at 12:20, Xinchen Hui <larue...@php.net> wrote:

> mixing declarations and codes sometimes brings unexpected
> varaibles overriden and hard to debugging.
>
> thanks
>
> --
> Xinchen Hui
> @Laruence
> http://www.laruence.com/


In a perfect world we would be able to enable the -Wshadow GCC
compiler warning which would shout when such bugs could pop out,
however variable shadowing is pretty common in the engine, and
unless someone knows a way to "baseline" the current warnings such
that only new/refactored code warns it seems like a long shot to get
to a state where we can do that.

Another related concern may be that a variable is not yet initialized,
which can be flagged using -W-jump-misses-init, however due to a
couple of limitations enabling it is not feasible without some small
compromises, see https://github.com/php/php-src/pull/5389

Best regards

George P. Banyard

Reply via email to