Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33461 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80132 invoked by uid 1010); 27 Nov 2007 16:41:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 80100 invoked from network); 27 Nov 2007 16:41:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2007 16:41:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=andy@petdance.com; spf=permerror; sender-id=softfail Authentication-Results: pb1.pair.com header.from=andy@petdance.com; sender-id=softfail Received-SPF: error (pb1.pair.com: domain petdance.com from 69.17.117.6 cause and error) X-PHP-List-Original-Sender: andy@petdance.com X-Host-Fingerprint: 69.17.117.6 mail4.sea5.speakeasy.net Linux 2.5 (sometimes 2.4) (4) Received: from [69.17.117.6] ([69.17.117.6:39154] helo=mail4.sea5.speakeasy.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/2A-09419-FE14C474 for ; Tue, 27 Nov 2007 11:12:32 -0500 Received: (qmail 4984 invoked from network); 27 Nov 2007 16:12:29 -0000 Received: from rocket.petdance.com (HELO uniqua.petdance.com) ([64.81.227.163]) (envelope-sender ) by mail4.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 27 Nov 2007 16:12:29 -0000 Received: from alester.flr.follett.com (host3130.follett.com [12.47.12.130]) by uniqua.petdance.com (Postfix) with ESMTP id 8F18B6ED8002; Tue, 27 Nov 2007 10:12:28 -0600 (CST) Cc: "Alexey Zakhlestin" , "Stanislav Malyshev" , internals@lists.php.net Message-ID: <56982F26-4D9B-4D03-9E7A-04FC35F157DD@petdance.com> To: Ilia Alshanetsky 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:12:02 -0600 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: andy@petdance.com (Andy Lester) On Nov 27, 2007, at 9:57 AM, Ilia Alshanetsky wrote: > 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. I'm trying to look at the code with the eyes of a human, trying to use the compiler as my ally, not something to be circumvented. GCC has most of the features of a good lint, if we take advantage of it. Think of it as compiler-enforced coding standards. My goal has been to try to raise up the coding level of the code that I see, that I'm using in my day-to-day work. The more seat belts the better, and initializing structs is just one of them. Adding consts and fixing signed/unsigned mismatches are on my list, too, but there's just so much that's slop that I'm trying to get the low-hanging fruit early. xoa -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance