Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33460 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66200 invoked by uid 1010); 27 Nov 2007 15:57:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66185 invoked from network); 27 Nov 2007 15:57:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2007 15:57:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain prohost.org from 209.85.198.188 cause and error) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 209.85.198.188 rv-out-0910.google.com Received: from [209.85.198.188] ([209.85.198.188:31015] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/69-09419-27E3C474 for ; Tue, 27 Nov 2007 10:57:40 -0500 Received: by rv-out-0910.google.com with SMTP id k15so1044662rvb for ; Tue, 27 Nov 2007 07:57:36 -0800 (PST) Received: by 10.140.251.1 with SMTP id y1mr1971099rvh.1196179056323; Tue, 27 Nov 2007 07:57:36 -0800 (PST) Received: from ?192.168.1.131? ( [76.65.228.201]) by mx.google.com with ESMTPS id a79sm5131203pye.2007.11.27.07.57.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2007 07:57:35 -0800 (PST) Cc: "Alexey Zakhlestin" , "Stanislav Malyshev" , internals@lists.php.net Message-ID: To: Andy Lester In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Tue, 27 Nov 2007 10:57:32 -0500 References: <20071127074757.GA25945@petdance.com> <474BDAF8.6020308@zend.com> <9AFAC4FC-6B0A-4917-8C5F-9DEA4827B3AB@petdance.com> X-Mailer: Apple Mail (2.915) Subject: Re: [PHP-DEV] [PATCH] Clean up struct initalizations From: ilia@prohost.org (Ilia Alshanetsky) Andy, There is absolutely nothing wrong with trying to make the code more maintainable, in fact I think everyone, myself included welcome any work in that direction. But at the same time we need to keep in mind that compiler is not always right and often will generate meaningless warnings even when there is absolutely nothing wrong the code. Changes for the sake of making the compiler happy with -Winsane-warnings ;-) does not really help maintainability. In the case of {0} vs {NULL, 0,0}, my opinion is that the former is far more readable and understandable. On 27-Nov-07, at 10:50 AM, Andy Lester wrote: > > On Nov 27, 2007, at 9:49 AM, Ilia Alshanetsky wrote: > >> 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. > > > My goal here is to improve long-term maintainability of the code, by > letting compilers and tools like splint do their automated magic > where possible. If this is not useful to the PHP core team, then > that's fine, I'll walk away. Let me know either way. > > xoa > > -- > Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance > > > > Ilia Alshanetsky