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 CE57B740048 for ; Tue, 12 Dec 2023 10:33:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3asGFQOlzvEtm0HN/A5lMDDlXItlfn5CzAjF4m+ZWlU=; 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; s=20140610; t=1702377204; v=1; b=J/ESnXy9zd+px/7QqZ4wjJ7o5x7oYgA1YDGddgQnrgfemtXKs+U5sgv/oWqgeJ7HApUEYixe LEF381BiWpbMPd+g0qtEz7hRHjH1i2zLp9hHTHKxcU6+JIMXt9MgeQbu++m59d+Qy4+h/7T04sP Oi5niRuXdHS/tKpwVte+X2gw= X-Received: by 127.0.0.2 with SMTP id mbnfYY7687511x3X6AzsxoRE; Tue, 12 Dec 2023 02:33:24 -0800 X-Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web11.13699.1702377203615414741 for ; Tue, 12 Dec 2023 02:33:23 -0800 X-Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-33330a5617fso5698096f8f.2 for ; Tue, 12 Dec 2023 02:33:23 -0800 (PST) X-Gm-Message-State: 6NAeUZfpXG8Laio7hdo6slTZx7686176AA= X-Google-Smtp-Source: AGHT+IGhkrhcReGvj/xqkWzBiV8IuEzPiGZ2Y7KWX/PM2CAy3ZT6a/SO3/o0M1BxCebNYUQgvwqYT2Mz1KgLLP87cNs= X-Received: by 2002:a05:6000:541:b0:333:3dd:6cc3 with SMTP id b1-20020a056000054100b0033303dd6cc3mr3041766wrf.21.1702377201843; Tue, 12 Dec 2023 02:33:21 -0800 (PST) MIME-Version: 1.0 References: <20231212084856.118099-1-mjsbeaton@gmail.com> In-Reply-To: From: "Mike Beaton" Date: Tue, 12 Dec 2023 10:33:10 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH] DebugLib: Allow -Wunneeded-internal-declaration with clang To: Ard Biesheuvel Cc: devel@edk2.groups.io, ardb@google.com, lersek@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,mjsbeaton@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="J/ESnXy9"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.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 > 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. 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. So without the pragmas we get instead errors such as: ``` /home/mjsbeaton/OpenSource/edk2/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c:444: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=0x%11p\n", (VOID *)(UINTN)DxeCoreAddress, FUNCTION_ENTRY_POINT (DxeCoreEntryPoint))); ^ ~ /home/mjsbeaton/OpenSource/edk2/MdePkg/Include/Library/DebugLib.h:432:16: note: expanded from macro 'DEBUG' (VOID) Expression; \ ^ 1 error generated. ``` -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112387): https://edk2.groups.io/g/devel/message/112387 Mute This Topic: https://groups.io/mt/103126777/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-