From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7326020945C16 for ; Wed, 13 Sep 2017 18:28:05 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 18:31:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,390,1500966000"; d="scan'208";a="900056656" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 13 Sep 2017 18:30:58 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 18:30:58 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 18:30:58 -0700 Received: from shsmsx152.ccr.corp.intel.com ([169.254.6.93]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.219]) with mapi id 14.03.0319.002; Thu, 14 Sep 2017 09:30:56 +0800 From: "Gao, Liming" To: "Zeng, Star" , Ard Biesheuvel , Laszlo Ersek , "Bi, Dandan" , "Wu, Hao A" CC: "Ni, Ruiyu" , "Dong, Eric" , edk2-devel-01 Thread-Topic: [edk2] [PATCH 2/2] MdeModulePkg/UdfDxe: suppress incorrect compiler warning in ReadFile() Thread-Index: AQHTLMFqGdAnIIHy7EmzGpuHIKcN6KKzBS2AgAAKhwCAAIep0A== Date: Thu, 14 Sep 2017 01:30:55 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E14E648@SHSMSX152.ccr.corp.intel.com> References: <20170912222612.14451-1-lersek@redhat.com> <20170912222612.14451-3-lersek@redhat.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B94098B@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B9409E7@shsmsx102.ccr.corp.intel.com> <23e789a8-59df-d67d-fa16-fc70aafb95d7@redhat.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B94A227@SHSMSX151.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B94E290@SHSMSX151.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103B94E290@SHSMSX151.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/2] MdeModulePkg/UdfDxe: suppress incorrect compiler warning in ReadFile() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2017 01:28:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Right. Just initialize them. They are not reported in VS2013&VS2015, becaus= e VS2013 and VS2015 disables this warning in ProcessorBind.h. If they are a= ll false warning messages, I think we can propose to disable this warning f= or all VS tool chain.=20 For GCC, if this warning is also false, could we add compiler to disable it= , like -Wno-unused-but-set-variable. > -----Original Message----- > From: Zeng, Star > Sent: Thursday, September 14, 2017 9:21 AM > To: Ard Biesheuvel ; Laszlo Ersek ; Gao, Liming ; Bi, Dandan > ; Wu, Hao A > Cc: Ni, Ruiyu ; Dong, Eric ; edk= 2-devel-01 > Subject: RE: [edk2] [PATCH 2/2] MdeModulePkg/UdfDxe: suppress incorrect c= ompiler warning in ReadFile() >=20 > Seemingly, VS has similar issue with GCC. >=20 > VS2010/VS2012 still have the building failures below after this patch. :( > edk2\mdemodulepkg\universal\disk\udfdxe\filesystemoperations.c(1083) : er= ror C2220: warning treated as error - no 'executable' file > generated > edk2\mdemodulepkg\universal\disk\udfdxe\filesystemoperations.c(1083) : wa= rning C4701: potentially uninitialized local variable > 'FilePosition' used > edk2\mdemodulepkg\universal\disk\udfdxe\filesystemoperations.c(1078) : wa= rning C4701: potentially uninitialized local variable > 'FinishedSeeking' used > edk2\mdemodulepkg\universal\disk\udfdxe\filesystemoperations.c(1167) : wa= rning C4701: potentially uninitialized local variable > 'Data' used > edk2\mdemodulepkg\universal\disk\udfdxe\filesystemoperations.c(1167) : wa= rning C4703: potentially uninitialized local pointer > variable 'Data' used >=20 >=20 > Liming, Dandan and Hao, > Do you remember how we fix this kind of false alarm before? > Just initialize the variable at the beginning of the function? >=20 >=20 >=20 > Thanks, > Star > -----Original Message----- > From: Zeng, Star > Sent: Thursday, September 14, 2017 8:43 AM > To: Ard Biesheuvel ; Laszlo Ersek > Cc: Ni, Ruiyu ; Dong, Eric ; edk= 2-devel-01 ; Gao, Liming > ; Zeng, Star > Subject: RE: [edk2] [PATCH 2/2] MdeModulePkg/UdfDxe: suppress incorrect c= ompiler warning in ReadFile() >=20 > Comparing adding workaround in code with suppressing it in *OLD* version = GCCs, I prefer the latter personally. >=20 >=20 > Thanks, > Star > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ar= d Biesheuvel > Sent: Thursday, September 14, 2017 2:52 AM > To: Laszlo Ersek > Cc: Ni, Ruiyu ; Dong, Eric ; edk= 2-devel-01 ; Gao, Liming > ; Zeng, Star > Subject: Re: [edk2] [PATCH 2/2] MdeModulePkg/UdfDxe: suppress incorrect c= ompiler warning in ReadFile() >=20 > On 13 September 2017 at 11:49, Laszlo Ersek wrote: > > On 09/13/17 08:43, Zeng, Star wrote: > >> Beyond the Rb (I do not want to block this patch series), I am curious= about one question. > >> > >> There may be more this kind of workarounds to fix the build failure. > >> Is it possible to disable the warning (like below example for VS) for = specific version of GCC for this kind of false alarm? > >> > >> > >> ProcessorBind.h: > >> #if defined(_MSC_EXTENSIONS) > >> > >> ... > >> > >> #if _MSC_VER =3D=3D 1800 || _MSC_VER =3D=3D 1900 > >> > >> // > >> // Disable these warnings for VS2013. > >> // > >> > >> // > >> // This warning is for potentially uninitialized local variable, and > >> it may cause false // positive issues in VS2013 and VS2015 build // > >> #pragma warning ( disable : 4701 ) > >> > >> // > >> // This warning is for potentially uninitialized local pointer > >> variable, and it may cause // false positive issues in VS2013 and > >> VS2015 build // #pragma warning ( disable : 4703 ) > >> > >> #endif > >> > >> #endif > > > > I think starting with gcc-4.6, gcc supports the "diagnostics" pragma, > > which can be used to suppress warnings. > > > > Unfortunately, there's no pragma to suppress *only* the incorrect > > warnings :) So if we set the pragma, we could lose even those warnings > > that point out real bugs. > > >=20 > That applies to the VS case as well. But I think doing this for older GCC= s is fine, most EDK2 developers use a newer version anyway, so > we will not lose any coverage by doing so. > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel