From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753697AbaIBN7w (ORCPT ); Tue, 2 Sep 2014 09:59:52 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:49949 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbaIBN7u (ORCPT ); Tue, 2 Sep 2014 09:59:50 -0400 Message-ID: <5405CD51.9020601@gmail.com> Date: Tue, 02 Sep 2014 16:59:45 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Bruce Fields CC: Trond Myklebust , Shakil A Khan , Linux NFS Mailing List , Linux Kernel mailing list , "netdev@vger.kernel.org" , Peter Zijlstra , Paul McKenney , William Andros Adamson , Jeffrey Layton , "David S. Miller" Subject: Re: [PATCH] Next branch: authgss: authgss.c: Fix warnings for uninitizlized variable expire References: <1409571154-50408-1-git-send-email-shakilk1729@gmail.com> <5405A15F.2060002@gmail.com> <20140902132140.GA31793@fieldses.org> In-Reply-To: <20140902132140.GA31793@fieldses.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02/2014 04:21 PM, Bruce Fields wrote: > > You'd rather avoid sprinkling that all over, though. If nothing else it > increases the chances you'll suppress a legimate warning some day. > But this is exactly why it was created. If you do the "= 0" then it is gone forever. If you have missed a legitimate needed assignment, it will be missed as well. But if you do the uninitialized_var() dance then there is a make option that turns it off and every once in a while people do a make with it to see if it still holds. The diff between foo = 0; and uninitialized_var(foo) is that the programmer is communicating to his friends that: "I have encountered a bogus compiler, this is falsely initialized" As opposed to =0 the compiler bug is covered up and forgotten > And unless I'm missing something this one really does look like an > unambiguous compiler bug. > Right! so that is how you specify this in code at Linux: uninitialized_var(foo); Putting =0 is way way worse, because it will never be revised and specially not automatically with a make switch. And leaving the warning on is even worse because two three of these and people start to ignore warnings. > --b. > uninitialized_var was made to be a friend not an enemy, in the face of real ugliness it is the best we can do. And that is what it should communicate to everyone. Why has it become everyone's favorite blasphemy I do not know. Cheers Boaz From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH] Next branch: authgss: authgss.c: Fix warnings for uninitizlized variable expire Date: Tue, 02 Sep 2014 16:59:45 +0300 Message-ID: <5405CD51.9020601@gmail.com> References: <1409571154-50408-1-git-send-email-shakilk1729@gmail.com> <5405A15F.2060002@gmail.com> <20140902132140.GA31793@fieldses.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Trond Myklebust , Shakil A Khan , Linux NFS Mailing List , Linux Kernel mailing list , "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Peter Zijlstra , Paul McKenney , William Andros Adamson , Jeffrey Layton , "David S. Miller" To: Bruce Fields Return-path: In-Reply-To: <20140902132140.GA31793-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On 09/02/2014 04:21 PM, Bruce Fields wrote: > > You'd rather avoid sprinkling that all over, though. If nothing else it > increases the chances you'll suppress a legimate warning some day. > But this is exactly why it was created. If you do the "= 0" then it is gone forever. If you have missed a legitimate needed assignment, it will be missed as well. But if you do the uninitialized_var() dance then there is a make option that turns it off and every once in a while people do a make with it to see if it still holds. The diff between foo = 0; and uninitialized_var(foo) is that the programmer is communicating to his friends that: "I have encountered a bogus compiler, this is falsely initialized" As opposed to =0 the compiler bug is covered up and forgotten > And unless I'm missing something this one really does look like an > unambiguous compiler bug. > Right! so that is how you specify this in code at Linux: uninitialized_var(foo); Putting =0 is way way worse, because it will never be revised and specially not automatically with a make switch. And leaving the warning on is even worse because two three of these and people start to ignore warnings. > --b. > uninitialized_var was made to be a friend not an enemy, in the face of real ugliness it is the best we can do. And that is what it should communicate to everyone. Why has it become everyone's favorite blasphemy I do not know. Cheers Boaz -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html