From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266487AbUGKCpa (ORCPT ); Sat, 10 Jul 2004 22:45:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266488AbUGKCp3 (ORCPT ); Sat, 10 Jul 2004 22:45:29 -0400 Received: from CPE-203-51-26-230.nsw.bigpond.net.au ([203.51.26.230]:26606 "EHLO e4.eyal.emu.id.au") by vger.kernel.org with ESMTP id S266487AbUGKCp2 (ORCPT ); Sat, 10 Jul 2004 22:45:28 -0400 Message-ID: <40F0A9C4.9000405@eyal.emu.id.au> Date: Sun, 11 Jul 2004 12:45:24 +1000 From: Eyal Lebedinsky Organization: Eyal at Home User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Use NULL instead of integer 0 in security/selinux/ References: <52r7rj7txj.fsf@topspin.com> In-Reply-To: <52r7rj7txj.fsf@topspin.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Roland Dreier wrote: > Suppose I have > > struct foo { > int a; > int b; > }; > > then sparse is perfectly happy with someone clearing out a struct foo > like this: > > struct foo bar = { 0 }; > > but then if someone changes struct foo to be > > struct foo { > void *x; > int a; > int b; > }; > > sparse will complain about that initialization, and all of the fixes > I can think of seem somewhat worse than the original to me: Come on, this is madness. By accident, the first memeber which changed from 'int' to 'void *' now accepts the old initializer. In my book this is a really bad thing because you just changed the semantics of the initialiser '{ 0 }' quietly. BTW, if nothing else, don't add new members at the top. -- Eyal Lebedinsky (eyal@eyal.emu.id.au)