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 760D2D8004D for ; Mon, 14 Aug 2023 22:51:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gVZtcNWFBtzOXCeVchGH03hrQaoWK3uIABH5gAq+aIw=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1692053485; v=1; b=fxIntOPIlNOdAHqx5fTCJ90cMNMGh6NSnaM+TRt9npplSBmgawitduBg++87qwl0L5FWiP0Z qjbjhBvjFeZtAEPdMDQpG1TCBGhYVpNrVoPcgSmnTRjblc+o0Iis4T5cJaOE/yNLlk3QFkzvRDd JaQ/Sp4/aIinXg+W3Tp21Mzo= X-Received: by 127.0.0.2 with SMTP id N7M5YY7687511xGrH24Poo22; Mon, 14 Aug 2023 15:51:25 -0700 X-Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by mx.groups.io with SMTP id smtpd.web10.121736.1692053485256922905 for ; Mon, 14 Aug 2023 15:51:25 -0700 X-Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-44781abd5a8so1933214137.1 for ; Mon, 14 Aug 2023 15:51:25 -0700 (PDT) X-Gm-Message-State: CwWzSghp7DjcLx8jVZS2qeZCx7686176AA= X-Google-Smtp-Source: AGHT+IHwKaWPlqTnZY5ZEK/8rHOgla+J1cRDN4klOjYR0A1XapYM1I3qhjUThoeeUQzlviGMjHs4dHIKslMHMZS2rZU= X-Received: by 2002:a67:e3aa:0:b0:447:6c16:5781 with SMTP id j10-20020a67e3aa000000b004476c165781mr8679258vsm.31.1692053484078; Mon, 14 Aug 2023 15:51:24 -0700 (PDT) MIME-Version: 1.0 References: <20230814204859.257-1-mikuback@linux.microsoft.com> In-Reply-To: <20230814204859.257-1-mikuback@linux.microsoft.com> From: "Pedro Falcato" Date: Mon, 14 Aug 2023 23:51:12 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH v1 0/7] Add DebugMacroCheck To: devel@edk2.groups.io, mikuback@linux.microsoft.com Cc: Abner Chang , Alexei Fedorov , Ard Biesheuvel , Gerd Hoffmann , Igor Kulchytskyy , Jian J Wang , Jiewen Yao , Jordan Justen , Leif Lindholm , Liming Gao , Michael D Kinney , Nickle Wang , Pierre Gondois , Sami Mujawar , Sean Brogan 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,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=fxIntOPI; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) On Mon, Aug 14, 2023 at 9:49=E2=80=AFPM Michael Kubacki wrote: > > From: Michael Kubacki > > Adds a new script and build plugin called DebugMacroCheck. > > The script verifies that the number of print specifiers 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: 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 > > Background: > > 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. > > See the following series for a batch of issues previously fixed in > edk2 discovered by the tool: > > https://edk2.groups.io/g/devel/message/93104 > > 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. > > 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. Hi, 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 Pedro -=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 (#107744): https://edk2.groups.io/g/devel/message/107744 Mute This Topic: https://groups.io/mt/100745693/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-