From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E49E47803CC for ; Tue, 15 Aug 2023 00:23:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=aoaOYqMkljpeO3TcsaNwvUWf38ClIMnIM0Ee4/agNm8=; c=relaxed/simple; d=groups.io; h=From:Message-id:MIME-version:Subject:Date:In-reply-to:Cc:To:References:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-type; s=20140610; t=1692059004; v=1; b=I62zymKUq0ai22tago48jEWHEqv7VbLSDqz+L+BSws7jGE75u6n1CbJeMq8fwUEQgqLGg8tH Xxisdu9UuCiMUwAM1s7iP2mXirANCQmAALmxrAc/5O3WgiwJ2cGFvERllYnj9LwiO5Xf8oeaUx5 NK3/4BmTTZRlf0LOcupuCbrY= X-Received: by 127.0.0.2 with SMTP id iJAiYY7687511xZxPRxR0Atz; Mon, 14 Aug 2023 17:23:24 -0700 X-Received: from ma-mailsvcp-mx-lapp01.apple.com (ma-mailsvcp-mx-lapp01.apple.com [17.32.222.22]) by mx.groups.io with SMTP id smtpd.web10.123446.1692059003705978492 for ; Mon, 14 Aug 2023 17:23:23 -0700 X-Received: from ma-mailsvcp-mta-lapp01.corp.apple.com (ma-mailsvcp-mta-lapp01.corp.apple.com [10.226.18.133]) by ma-mailsvcp-mx-lapp01.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0RZE00DN1P2YFB10@ma-mailsvcp-mx-lapp01.apple.com> for devel@edk2.groups.io; Mon, 14 Aug 2023 17:23:23 -0700 (PDT) X-Proofpoint-GUID: s3u281MpZGM0i41DJAo8CByQFAp8U5gd X-Proofpoint-ORIG-GUID: s3u281MpZGM0i41DJAo8CByQFAp8U5gd X-Received: from ma-mailsvcp-mmp-lapp02.apple.com (ma-mailsvcp-mmp-lapp02.apple.com [17.32.222.15]) by ma-mailsvcp-mta-lapp01.corp.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0RZE00VTXP2YGL00@ma-mailsvcp-mta-lapp01.corp.apple.com>; Mon, 14 Aug 2023 17:23:22 -0700 (PDT) X-Received: from process_milters-daemon.ma-mailsvcp-mmp-lapp02.apple.com by ma-mailsvcp-mmp-lapp02.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0RZE00E00OX3GN00@ma-mailsvcp-mmp-lapp02.apple.com>; Mon, 14 Aug 2023 17:23:22 -0700 (PDT) X-Va-A: X-Va-T-CD: fb9ca77e010fb2e9e052c364a80d126f X-Va-E-CD: c51aabcee4ed1cb91c3a9cdee7e1cc98 X-Va-R-CD: 1e06e21a91ba478d544276c36c3bda2a X-Va-ID: 5a77f806-3c69-40ba-b12a-17e192ee5c7e X-Va-CD: 0 X-V-A: X-V-T-CD: fb9ca77e010fb2e9e052c364a80d126f X-V-E-CD: c51aabcee4ed1cb91c3a9cdee7e1cc98 X-V-R-CD: 1e06e21a91ba478d544276c36c3bda2a X-V-ID: 3b920ef3-71aa-4a9b-80be-c4d5ba8f3520 X-V-CD: 0 X-Received: from smtpclient.apple (unknown [17.234.154.19]) by ma-mailsvcp-mmp-lapp02.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0RZE00C5KP2VOZ00@ma-mailsvcp-mmp-lapp02.apple.com>; Mon, 14 Aug 2023 17:23:22 -0700 (PDT) From: "Andrew Fish via groups.io" Message-id: MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: [edk2-devel] [PATCH v1 0/7] Add DebugMacroCheck Date: Mon, 14 Aug 2023 17:23:08 -0700 In-reply-to: Cc: Michael Kubacki , Abner Chang , Alexei Fedorov , Ard Biesheuvel , Gerd Hoffmann , Igor Kulchytskyy , Jian J Wang , Jiewen Yao , Jordan Justen , Leif Lindholm , Liming Gao , Mike Kinney , Nickle Wang , Pierre Gondois , Sami Mujawar , Sean Brogan To: edk2-devel-groups-io , Pedro Falcato References: <20230814204859.257-1-mikuback@linux.microsoft.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 Reply-To: devel@edk2.groups.io,afish@apple.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: tNdLskjy5moDMuGs80Vi6tAlx7686176AA= Content-type: multipart/alternative; boundary="Apple-Mail=_4188A533-AD79-457B-8DAE-924EB342E5CC" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=I62zymKU; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --Apple-Mail=_4188A533-AD79-457B-8DAE-924EB342E5CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 14, 2023, at 3:51 PM, Pedro Falcato wrot= e: >=20 > On Mon, Aug 14, 2023 at 9:49=E2=80=AFPM Michael Kubacki > > wrot= e: >>=20 >> From: Michael Kubacki >>=20 >> Adds a new script and build plugin called DebugMacroCheck. >>=20 >> The script verifies that the number of print specifiers match the >> number of arguments in DEBUG() calls. >>=20 >> Overview: >>=20 >> - Build plugin: BuildPlugin/DebugMacroCheckBuildPlugin.py >> - Runs on any build target that is not NO-TARGET >> - Standalone script: DebugMacroCheck.py >> - Run `DebugMacroCheck.py --help` to see command line options >> - Unit tests: >> - Tests/test_DebugMacroCheck.py >> - Can be run with: >> `python -m unittest discover -s ./.pytool/Plugin/DebugMacroCheck/test= s -v` >> - Also visible in VS Code Test Explorer >>=20 >> Background: >>=20 >> The tool has been constantly run against edk2 derived code for about >> a year now. During that time, its found over 20 issues in edk2, over >> 50 issues in various vendor code, and numerous other issues specific >> to Project Mu. >>=20 >> See the following series for a batch of issues previously fixed in >> edk2 discovered by the tool: >>=20 >> https://edk2.groups.io/g/devel/message/93104 >>=20 >> I've received interest from vendors to place it in edk2 to >> immediately find issues in the upstream and make it easier for edk2 >> consumers to directly acquire it. That led to this patch series. >>=20 >> This would run in edk2 as a build plugin. All issues in the edk2 >> codebase have been resolved so this would find new issues before >> they are merged into the codebase. >=20 > Hi, >=20 > I really like this change but I cannot stop and think that if DEBUG > and PrintLib were ISO C compliant, we could be using normal interfaces > with normal argument types and the compiler's intrinsic knowledge of > printf-like functions. > Have you explored that option for future code? See e.g > https://godbolt.org/z/4e8d3WToT (I don't know what MSVC uses, if > anything). >=20 I have a dream that we add an eft_print as an attribute format archetype an= d then do what you recommend. After all clang and gcc are open source.=20 Thanks, Andrew Fish > --=20 > Pedro >=20 >=20 >=20 -=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 (#107746): https://edk2.groups.io/g/devel/message/107746 Mute This Topic: https://groups.io/mt/100745693/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --Apple-Mail=_4188A533-AD79-457B-8DAE-924EB342E5CC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Aug 14, 2023, at 3:51 PM, Pedro Falcato <pedro.falcato@gma= il.com> wrote:

On Mon, Aug 14, 2023 at 9:49=E2=80=AFPM Michael Kubacki<m= ikuback@linux.microsoft.com> wrote:

From: Michael Kubacki <mich= ael.kubacki@microsoft.com>

Adds a new script and build plugin cal= led DebugMacroCheck.

The script verifies that the number of print sp= ecifiers match the
number of arguments in DEBUG() calls.

Overview= :

- Build plugin: BuildPlugin/DebugMacroCheckBuildPlugin.py
 = ;- Runs on any build target that is not NO-TARGET
- Standalone script: D= ebugMacroCheck.py
 - Run `DebugMacroCheck.py --help` to see command= line options
- Unit tests:
 - Tests/test_DebugMacroCheck.py
=  - Can be run with:
   `python -m unittest discover = -s ./.pytool/Plugin/DebugMacroCheck/tests -v`
 - Also visible in VS= Code Test Explorer

Background:

The tool has been constantly = run against edk2 derived code for about
a year now. During that time, it= s found over 20 issues in edk2, over
50 issues in various vendor code, a= nd numerous other issues specific
to Project Mu.

See the followin= g series for a batch of issues previously fixed in
edk2 discovered by th= e tool:

 https://edk2.groups.io/g/devel/message/93104

I'= ve received interest from vendors to place it in edk2 to
immediately fin= d issues in the upstream and make it easier for edk2
consumers to direct= ly acquire it. That led to this patch series.

This would run in edk2= as a build plugin. All issues in the edk2
codebase have been resolved s= o this would find new issues before
they are merged into the codebase.

Hi,

I really like this change but I cannot stop and think that if DE= BUG
and PrintLib were ISO C compliant, we could be = using normal interfaces
with normal argument types = and the compiler's intrinsic knowledge of
printf-li= ke functions.
Have you explored that option for fut= ure code? See e.g
https://godbolt.org/z/4e8d3WToT (I don't know what MSVC uses, if
anything).


I have a dream that we add an eft_print = as an attribute format archetype and then do what you recommend. After all = clang and gcc are open source. 

Thanks,
=

Andrew Fish

-- 
= Pedro



_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#107746) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--Apple-Mail=_4188A533-AD79-457B-8DAE-924EB342E5CC--