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 7B15EAC16D5 for ; Tue, 12 Dec 2023 15:27:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=LvQkgE81XJRQzCpJfGDPorCJoN9KXH/S4U0rMNEhKBY=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702394824; v=1; b=flms3N5Zu5sH6ZpbNjt0FIzc+u5xoIXKjESZxGo5H9OHeNnTxjH0qe+fFpXgIYQ0c2FPt9fs x9w0/DKRlyD3uS1ffXFjQ1x0hAj/ssIBLL9MEeBCRud2RloxLtCQkYBLxVXg72VJ3NL0hjttsCP sWpRQHm66hTJoLZ42MpcsnIs= X-Received: by 127.0.0.2 with SMTP id 7MCLYY7687511xSkLTEEHkCi; Tue, 12 Dec 2023 07:27:04 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.4455.1702394823480591998 for ; Tue, 12 Dec 2023 07:27:03 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-3aj4AfYVPIOIGw-xDpFaHQ-1; Tue, 12 Dec 2023 10:26:58 -0500 X-MC-Unique: 3aj4AfYVPIOIGw-xDpFaHQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C40CC101E154; Tue, 12 Dec 2023 15:26:57 +0000 (UTC) X-Received: from [10.39.192.120] (unknown [10.39.192.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16F503C2E; Tue, 12 Dec 2023 15:26:56 +0000 (UTC) Message-ID: <90ab2076-96ac-ae22-1595-55861c1e24ea@redhat.com> Date: Tue, 12 Dec 2023 16:26:55 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang To: Mike Beaton , Ard Biesheuvel Cc: devel@edk2.groups.io, ardb@google.com References: <20231212084856.118099-1-mjsbeaton@gmail.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AHjNZXV5XHtTLx2rS9AFkXi7x7686176AA= Content-Language: en-US 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=flms3N5Z; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=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 On 12/12/23 11:33, Mike Beaton wrote: >> This seems redundant to me. Either we set the pragma and the compiler >> does not care, or we don't, and rely on the fact that the compiler can >> infer that 'Expression' will never be evaluated at runtime, but won't >> complain about symbols that are only referenced via 'Expression' and >> nowhere else. >=20 > I thought so too on initially reading the code, so I tried removing > the pragmas, and in fact the pragma is to tell the compiler not to > warn about the contained `(VOID) Expression`, not to fix the actual > problem warning - which `(VOID) Expression` itself does, once allowed. >=20 > So without the pragmas we get instead errors such as: >=20 > ``` > /home/mjsbeaton/OpenSource/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c:44= 4:86: > error: expression result unused; should this cast be to 'void'? > [-Werror,-Wunused-value] > DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Loading DXE CORE at 0x%11p > EntryPoint=3D0x%11p\n", (VOID *)(UINTN)DxeCoreAddress, > FUNCTION_ENTRY_POINT (DxeCoreEntryPoint))); >=20 > ^ ~ > /home/mjsbeaton/OpenSource/edk2/MdePkg/Include/Library/DebugLib.h:432:16: > note: expanded from macro 'DEBUG' > (VOID) Expression; \ > ^ > 1 error generated. > ``` >=20 FWIW: Acked-by: Laszlo Ersek -=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 (#112448): https://edk2.groups.io/g/devel/message/112448 Mute This Topic: https://groups.io/mt/103126777/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-