Re: [PATCH] Clean up struct initalizations
| From: | Ilia Alshanetsky | Date: | Tue, 27 Nov 2007 15:49:04 +0000 |
| Subject: | Re: [PATCH] Clean up struct initalizations | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33458@lists.php.net to get a copy of this message | ||
GCC will spue a slew of warnings that can be safely ignored and in some cases are bogus. The pedantic changes only make the code harder to read and yield very little if any benefits in return. For larger, more complex structs like zvals it'll only create a meaningless mess. There is absolutely no reason that any half decent compiler will not be able to understand {0} for any declared struct.
On 27-Nov-07, at 10:12 AM, Andy Lester wrote:
On Nov 27, 2007, at 8:34 AM, Alexey Zakhlestin wrote:Ilia AlshanetskyOn 11/27/07, Ilia Alshanetsky <ilia@prohost.org> wrote:It also means that you don't get compiler errors any more like you would with {0}. Now, you can know that if there's a warning about the number of initializers that it's something you should pay attention to. The key for long-term maintenance is to clean up the slop so that the compiler doesn't squawk about it at high levels of warnings. Then when you do have real squawk-worthy problems, they don't get lost in the noise of meaningless warnings. -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdanceIMHO {0} is sufficiently clear for human consumption.{NULL, 0, 0} brings real structure dimensions to the context, which is good (less need to check "headers").