From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dibyendu Majumdar Subject: Re: Potential incorrect simplification Date: Sun, 6 Aug 2017 18:04:18 +0100 Message-ID: References: <20170328141113.kbrwdva6ttsrokts@macpro.local> <20170806140035.f2tqkmiufjytiwri@ltop.local> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-wm0-f54.google.com ([74.125.82.54]:37315 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbdHFRET (ORCPT ); Sun, 6 Aug 2017 13:04:19 -0400 Received: by mail-wm0-f54.google.com with SMTP id t201so52585614wmt.0 for ; Sun, 06 Aug 2017 10:04:19 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Luc Van Oostenryck Cc: Christopher Li , Linus Torvalds , Linux-Sparse On 6 August 2017 at 17:56, Luc Van Oostenryck wrote: > On Sun, Aug 6, 2017 at 5:52 PM, Dibyendu Majumdar > wrote: >> Hi, >> >> I would like to assert that in the C code there was no attempt to >> access uninitialized value. If you have a look at the original report >> here: >> >> http://marc.info/?l=linux-sparse&m=149070715427276&w=2 >> >> You will see that the C code assigns a value to the field before >> attempting to access it as shown below. >> >> s3.onebit = 1; >> if(s3.onebit != 1){ >> } > > True but this should be solved by patch b1672eab399fdce2c050e8aa07767489a2071981 > available since -rc1. > Isn't it the case? > Wouldn't have thought so - as the variable is not initialized at the point of declaration. The assignment occurs after declaring the struct variable s3. I haven't tried that patch though. Regards Dibyendu