Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756671AbZJSP3S (ORCPT ); Mon, 19 Oct 2009 11:29:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756625AbZJSP3R (ORCPT ); Mon, 19 Oct 2009 11:29:17 -0400 Received: from cantor.suse.de ([195.135.220.2]:48599 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756548AbZJSP3Q (ORCPT ); Mon, 19 Oct 2009 11:29:16 -0400 Date: Mon, 19 Oct 2009 17:29:20 +0200 (CEST) From: Jiri Kosina X-X-Sender: jkosina@wotan.suse.de To: Felipe Contreras Cc: linux-kernel@vger.kernel.org, Heiko Carstens Subject: Re: [PATCH 2/7] ipc: fix trivial warning In-Reply-To: <94a0d4530910190815n4cf2c2ebmd288f6e7501b1ba5@mail.gmail.com> Message-ID: References: <1255906474-25091-1-git-send-email-felipe.contreras@gmail.com> <1255906474-25091-3-git-send-email-felipe.contreras@gmail.com> <94a0d4530910190750j5674ef13m93198b68d305b188@mail.gmail.com> <94a0d4530910190815n4cf2c2ebmd288f6e7501b1ba5@mail.gmail.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="168427776-1551833554-1255966160=:8582" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2356 Lines: 57 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --168427776-1551833554-1255966160=:8582 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 19 Oct 2009, Felipe Contreras wrote: > >> >> ipc/msg.c: In function ?msgctl_down?: > >> >> ipc/msg.c:415: warning: ?msqid64? may be used uninitialized in this function > >> >> > >> >> Signed-off-by: Felipe Contreras > >> >> --- > >> >>  ipc/msg.c |    2 +- > >> >>  1 files changed, 1 insertions(+), 1 deletions(-) > >> >> > >> >> diff --git a/ipc/msg.c b/ipc/msg.c > >> >> index 2ceab7f..085bd58 100644 > >> >> --- a/ipc/msg.c > >> >> +++ b/ipc/msg.c > >> >> @@ -412,7 +412,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, > >> >>                      struct msqid_ds __user *buf, int version) > >> >>  { > >> >>       struct kern_ipc_perm *ipcp; > >> >> -     struct msqid64_ds msqid64; > >> >> +     struct msqid64_ds uninitialized_var(msqid64); > >> >>       struct msg_queue *msq; > >> >>       int err; [ ... snip ... ] > > I have verified both with 4.1 and 4.3, and it doesn't emit this > > false-positive warning, so there have been gcc versions getting this > > right. Ergo gcc developers should rather fix this "regression" and revert > > to the old behavior, methinks. > > The other possibility is that the bug was in gcc 4.1/4.3, and now 4.4 > finds an actual problem in the code. I will try to dig deeper to see > what's actually happening... at first glance I don't see who is > initializing msqid64. This statement of your makes me wonder why you have submitted the patch in the first place, as you are apparently not sure whether adding uninitialized_var() is a valid thing to do or not. The gcc warning in this case is actually bogus, as msqid64 is touched only iff cmd == IPC_SET, and in such case, copy_msqid_from_user() initializes it properly. -- Jiri Kosina SUSE Labs, Novell Inc. --168427776-1551833554-1255966160=:8582-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/