From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id BFE8BD8027A for ; Mon, 14 Oct 2024 17:09:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=XzKoqLXaHFnRtA5FIF/qXF7vMpJUvfVD/NRokjp+iUE=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240830; t=1728925782; v=1; x=1729184981; b=eXM3IxZLu/RkdnXdUhKiPV2heYX6aMY/+EKnTpkN7sSkhuRPqJWd0seudFwlLPtHcZ1iJoOa mpMEtGPwNVtzf7tvxbglhzaKLwn/FxYrNESx9bOaPT7C16ThjjcEFXfjPxD8cMrRgtU5BDtCV1x VMBwbT463/UOS1sl7f9x6lrQ0E09dii1m075Gq37QMGrJSbinOgGBXGZBUbgUirD5Y+0BBEpNl9 VTsQTfOHx74VB/T4yB1HqPvu4Zi1kjcfKtXkrLD+UObV/RyHWqXn8j1NsWHddaq1caJEupLdcpt ylRfzyp/EnKDlc6Re7ORycCmRW2PPLY22Ne7SAci4pcPw== X-Received: by 127.0.0.2 with SMTP id RgXaYY7687511xCc5deiGj7M; Mon, 14 Oct 2024 10:09:41 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.257.1728925780664093503 for ; Mon, 14 Oct 2024 10:09:40 -0700 X-Received: from [10.137.194.171] (unknown [131.107.159.43]) by linux.microsoft.com (Postfix) with ESMTPSA id E262D20DF171; Mon, 14 Oct 2024 10:09:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E262D20DF171 Message-ID: <576d27b9-2bac-4b44-b864-6eca9f57219e@linux.microsoft.com> Date: Mon, 14 Oct 2024 10:09:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` To: devel@edk2.groups.io, rebecca@bsdio.com, Sean Brogan , Michael Kinney References: <20241011012040.274642-1-rebecca@bsdio.com> <2b59d0dd-3426-4741-a2a9-18275dd613b5@bsdio.com> <73f096d9-37fc-4b9c-9169-7f70268abdcf@linux.microsoft.com> <4e1f3410-b1f6-4f26-a04f-67f2a9cdcfcb@bsdio.com> From: "Oliver Smith-Denny" In-Reply-To: <4e1f3410-b1f6-4f26-a04f-67f2a9cdcfcb@bsdio.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 14 Oct 2024 10:09:40 -0700 Resent-From: osde@linux.microsoft.com Reply-To: devel@edk2.groups.io,osde@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: zTkv3Zhhn0Mr2Q0P2WMQFVJex7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=eXM3IxZL; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=none) On 10/14/2024 9:47 AM, Rebecca Cran wrote: > On 10/14/24 9:22 AM, Oliver Smith-Denny wrote: >> In GoogleTest, you often cannot directly include the C file in the >> GoogleTest file, because C++ complains about many Cisms, mostly >> our use of casting. >=20 > Do you have an example of that? This was a little while back, so my only memory is of the Mu code I updated the STATIC undef'ing for, one of these two: https://github.com/microsoft/mu_plus/blob/dev/202405/AdvLoggerPkg/AdvLogger= OsConnectorPrm/GoogleTest/AdvLoggerOsConnectorPrmGoogleTest.cpp https://github.com/microsoft/mu_plus/blob/dev/202405/AdvLoggerPkg/AdvLogger= OsConnectorPrm/Library/AdvLoggerOsConnectorPrmConfigLib/GoogleTest/AdvLogge= rPrmConfigLibGoogleTest.cpp We had issues in edk2 as well, I just don't remember specific examples. It is more likely than not that if you try to write a GoogleTest and include the C file you'll fail compilation. >=20 > Also, I've seen suggestions (I think on the FreeBSD mailing lists) of=20 > using C++ as "a better C". That is, not using any C++ specific features= =20 > but building the code as C++ because apparently you get better code=20 > checking and diagnostics with it. Though you do lose some features like= =20 > implicit casts from void* when using C++. I would take umbrage with the statement that C++ is a better C :). I do not think we gain value and in fact lose quite a lot of things, name mangling, lots of churn, etc. TBH, I have not been convinced of the value of adding C++ into edk2 with GoogleTest, I think it has added complications and very few new edk2 unit tests. Hopefully platform owners are getting good usage out of it. Oliver -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120622): https://edk2.groups.io/g/devel/message/120622 Mute This Topic: https://groups.io/mt/108941574/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-