From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::241; helo=mail-io0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9528421E0B9E0 for ; Wed, 7 Feb 2018 01:41:32 -0800 (PST) Received: by mail-io0-x241.google.com with SMTP id d13so1351781iog.5 for ; Wed, 07 Feb 2018 01:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sqvtotu41h351ccshOeS4vhi0iwgYfF5h8mBqSVxRWQ=; b=Z1PXL893fzWjTKXkk40WeORDMKbxqun/VelLqh9wKWmPIBoIjTdn7WL2zD3W8zPGzm roOwbae81ABN+Ck/lAmFYFQbdXe7mJQL7SWSczPijrQdLIOJqaqAjpAHCVVEu0gmhcds EYNQ63+Nj5weZw4k9BQW1Eg9gSeJgNAT2pc4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sqvtotu41h351ccshOeS4vhi0iwgYfF5h8mBqSVxRWQ=; b=hxUFQQ3TAhoXTOdQavYaXncH2juqvHQ9ynUCmmbncoZc/joIT0X4Tsu0wU6EGeOWNl NKutBdiS5BolUaWbLJc52ny+gEa+BbBfVxEZs44PO/XELDTCcS1Hk7OP2gt9f87BhrPQ ewYr4oJCHbX5J//khm8u7Ov27Wab8I1yYmqaUZ6ndq5vyNNhdPo5rQy5pqVZ7C1LlS9B SMGHooZDU+MbZSHekgFEfNINMnVJ0qG4Eo2huOuvo7yeBmoPKQXEHENOYVIwa0iOd1ms cOonVQjI0GE/0/6FS8QW5EghBXnk6k8ayfRJ/6oxq1oDvlOh0IDDhlmqyzVtLLDs+096 Kr3Q== X-Gm-Message-State: APf1xPDBsmT7f3vZRXssF19nH1HlkCCMhP2XriEC6DENBhn2n3gYnGlX WPtPEKdPL90mVJyBf5KYhcKCafFIgFNEjw54pZkl3A== X-Google-Smtp-Source: AH8x2263QacPoG+S/VRojXkC3KzxbrSUhhYNA7/pMp1QZYsxmU1hFCdwVVfMOv+HU7eba5tPQYTjQYSKcayQ8lH+6S4= X-Received: by 10.107.33.65 with SMTP id h62mr6600100ioh.104.1517996835103; Wed, 07 Feb 2018 01:47:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.112.13 with HTTP; Wed, 7 Feb 2018 01:47:14 -0800 (PST) In-Reply-To: <20180206220115.29193-3-lersek@redhat.com> References: <20180206220115.29193-1-lersek@redhat.com> <20180206220115.29193-3-lersek@redhat.com> From: Ard Biesheuvel Date: Wed, 7 Feb 2018 10:47:14 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Brijesh Singh , Jordan Justen Subject: Re: [PATCH 2/2] OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with declaration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 09:41:33 -0000 Content-Type: text/plain; charset="UTF-8" On 6 February 2018 at 23:01, Laszlo Ersek wrote: > "Platform.h" declares the AmdSevInitialize() function without EFIAPI, but > the definition in "AmdSev.c" includes EFIAPI. > > GCC toolchains without LTO do not catch this error because "AmdSev.c" does > not include "Platform.h"; i.e. the declaration used by callers such as > "Platform.c" is not actually matched against the function definition at > build time. > > With LTO enabled, the mismatch is found -- however, as a warning only, due > to commit f8d0b9662993 ("BaseTools GCC5: disable warnings-as-errors for > now", 2016-08-03). > > Include the header in the C file (which turns the issue into a hard build > error on all GCC toolchains), plus sync the declaration from the header > file to the C file. > > There's been no functional breakage because AmdSevInitialize() takes no > parameters. > > Cc: Ard Biesheuvel > Cc: Brijesh Singh > Cc: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek Acked-by: Ard Biesheuvel > --- > OvmfPkg/PlatformPei/AmdSev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c > index 1539e5b5cdce..ad31b69fb032 100644 > --- a/OvmfPkg/PlatformPei/AmdSev.c > +++ b/OvmfPkg/PlatformPei/AmdSev.c > @@ -23,6 +23,8 @@ > #include > #include > > +#include "Platform.h" > + > /** > > Function checks if SEV support is available, if present then it sets > @@ -30,7 +32,6 @@ > > **/ > VOID > -EFIAPI > AmdSevInitialize ( > VOID > ) > -- > 2.14.1.3.gb7cf6e02401b >