From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-170.mimecast.com (us-smtp-delivery-170.mimecast.com [216.205.24.170]) by mx.groups.io with SMTP id smtpd.web10.5242.1600999025172308105 for ; Thu, 24 Sep 2020 18:57:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@phoenix.com header.s=mimecast20170203 header.b=p1pYHks0; spf=pass (domain: phoenix.com, ip: 216.205.24.170, mailfrom: ken_taylor@phoenix.com) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phoenix.com; s=mimecast20170203; t=1600999023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZTJ6Mu1V7tqtztuwdYERDeok05ngb+UikODmqigOOjk=; b=p1pYHks0VYpAnF5A9RFeKf5HAGzV3gt+KETV4k8s+lEYqj/DT1XhoJijtgegmBluwjFEhK l7vCRd2ILzUc3gbUhupdCHaV15gYSa9p9HU6nAXC8pXIP/Z8CDmrawqzQotwvfYKSxiDlG med6meiPuBKoSawUaeJ/hLHwR15p3NE= Received: from SCL-EXCHMB-13.phoenix.com (67.51.239.50 [67.51.239.50]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-oH6i4c0hOKmvOhSWDb-WAA-1; Thu, 24 Sep 2020 21:57:00 -0400 X-MC-Unique: oH6i4c0hOKmvOhSWDb-WAA-1 X-CrossPremisesHeadersFilteredBySendConnector: SCL-EXCHMB-13.phoenix.com Received: from SCL-EXCHMB-13.phoenix.com (10.122.68.16) by SCL-EXCHMB-13.phoenix.com (10.122.68.16) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Thu, 24 Sep 2020 18:56:57 -0700 Received: from SCL-EXCHMB-13.phoenix.com ([fe80::fd2e:a8f8:f740:cb3b]) by SCL-EXCHMB-13.phoenix.com ([fe80::fd2e:a8f8:f740:cb3b%12]) with mapi id 15.00.1156.000; Thu, 24 Sep 2020 18:56:57 -0700 From: "Ken Taylor" To: "devel@edk2.groups.io" , "bret.barkelew@microsoft.com" Subject: Re: ECC: Won't somebody PLEASE think of the... test structures. Thread-Topic: ECC: Won't somebody PLEASE think of the... test structures. Thread-Index: AQHWktooEicGg8j40UW1Z0xLUDeoV6l4lrAQ Date: Fri, 25 Sep 2020 01:56:56 +0000 Message-ID: <29096719f8d541c3aa25f9738a61b1d3@SCL-EXCHMB-13.phoenix.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [73.118.245.182] MIME-Version: 1.0 X-OrganizationHeadersPreserved: SCL-EXCHMB-13.phoenix.com Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA70A150 smtp.mailfrom=ken_taylor@phoenix.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: phoenix.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_29096719f8d541c3aa25f9738a61b1d3SCLEXCHMB13phoenixcom_" --_000_29096719f8d541c3aa25f9738a61b1d3SCLEXCHMB13phoenixcom_ Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable If the structure is a non-static local variable, most compilers will silent= ly inject an intrinsic call to memcpy in function initialization. This lea= ds to an intermittent linker error. If the compiler you use automatically supports an intrinsic memcpy in the = given architecture or optimizes out the memcpy, it will build for you and y= ou won't know you need to link to an intrinsic support library in order to = build cross platform. This leads to code that builds for you, but not for = me. Regards, -Ken. From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bret= Barkelew via groups.io Sent: Thursday, September 24, 2020 6:23 PM To: devel@edk2.groups.io Subject: [edk2-devel] ECC: Won't somebody PLEASE think of the... test stru= ctures. ERROR - EFI coding style error ERROR - *Error code: 5007 ERROR - *There should be no initialization of a variable as part of its de= claration ERROR - *file: //home/corthon/_uefi/edk2_qemu_ci/edk2/MdeModulePkg/Library= /VariablePolicyLib/VariablePolicyUnitTest/VariablePolicyUnitTest.c ERROR - *Line number: 333 ERROR - *Variable Name: MatchCheckPolicy EccCheck no likey: SIMPLE_VARIABLE_POLICY_ENTRY ValidationPolicy =3D { { VARIABLE_POLICY_ENTRY_REVISION, sizeof(VARIABLE_POLICY_ENTRY) + sizeof(TEST_VAR_1_NAME), sizeof(VARIABLE_POLICY_ENTRY), TEST_GUID_1, TEST_POLICY_MIN_SIZE_NULL, TEST_POLICY_MAX_SIZE_NULL, TEST_POLICY_ATTRIBUTES_NULL, TEST_POLICY_ATTRIBUTES_NULL, VARIABLE_POLICY_TYPE_NO_LOCK }, TEST_VAR_1_NAME }; But you can't init this structure separately without addressing each field= . Can a brother get an override? - Bret --_000_29096719f8d541c3aa25f9738a61b1d3SCLEXCHMB13phoenixcom_ Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable

If the structure is a= non-static local variable, most compilers will silently inject an intrinsi= c call to memcpy in function initialization.  This leads to an intermi= ttent linker error.

 

If the compiler you u= se automatically supports an intrinsic memcpy in the given architecture or = optimizes out the memcpy, it will build for you and you won’t know yo= u need to link to an intrinsic support library in order to build cross platform.  This leads to code that builds fo= r you, but not for me.

 

Regards,

-Ken.

 

From: devel@e= dk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bret Barkelew via groups.io
Sent: Thursday, September 24, 2020 6:23 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] ECC: Won't somebody PLEASE think of the... te= st structures.

 

ERROR - EFI coding style error

ERROR - *Error code: 5007

ERROR - *There should be no initialization of a var= iable as part of its declaration

ERROR - *file: //home/corthon/_uefi/edk2_qemu_ci/ed= k2/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePo= licyUnitTest.c

ERROR - *Line number: 333

ERROR - *Variable Name: MatchCheckPolicy=

 

EccCheck no likey:

SIMPLE_VARIABLE_POLICY_ENTRY   Validation= Policy =3D {

    {

      VARIABLE_POLICY_ENTR= Y_REVISION,

      sizeof(VARIABLE_POLI= CY_ENTRY) + sizeof(TEST_VAR_1_NAME),

      sizeof(VARIABLE_POLI= CY_ENTRY),

      TEST_GUID_1,

      TEST_POLICY_MIN_SIZE= _NULL,

      TEST_POLICY_MAX_SIZE= _NULL,

      TEST_POLICY_ATTRIBUT= ES_NULL,

      TEST_POLICY_ATTRIBUT= ES_NULL,

      VARIABLE_POLICY_TYPE= _NO_LOCK

    },

    TEST_VAR_1_NAME

  };

 

But you can’t init this structure separately = without addressing each field.

Can a brother get an override?

 

- Bret

 

--_000_29096719f8d541c3aa25f9738a61b1d3SCLEXCHMB13phoenixcom_--