Re: Turn on error on mixed declarations (Was: New extension proposal: meta)
| From: | Flavius Aspra | Date: | Sun, 04 Sep 2011 11:15:34 +0000 |
| Subject: | Re: Turn on error on mixed declarations (Was: New extension proposal: meta) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals php.pecl.dev |
| Request: | Send a blank email to internals+get-55186@lists.php.net to get a copy of this message | ||
On 09/04/2011 05:28 AM, Gustavo Lopes wrote:
On Sun, 04 Sep 2011 04:05:32 +0100, Kalle Sommer Nielsen<kalle@php.net> wrote:Thanks, I've compiled it with this parameter and I've fixed those mistakes. DISCLAIMER: I know playing around with CFLAGS in config.m4 is bad, those bits will be removed as documented in the lines right above that What else could I improve, beside the bits I already know about, which are documented in the code (as TODOs) and in TODO.txt? Cheers, Flavius2011/9/3 Arpad Ray<arraypad@gmail.com>:By the way, since committing code with mixed declarations is a frequent problem -- GCC accepts it even without -std=C99 yet the Windows builds are broken --, we could make GCC treat this as an error with: -Werror=declaration-after-statement- Variable declarations should always begin a block, some platforms will bork otherwise.Actually this is required for the C standard, the early ones that we use in PHP, whereas C++ allows them anywhere in a block, like PHP does :)