From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web12.13641.1583590946973164344 for ; Sat, 07 Mar 2020 06:22:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=gzAui6Fj; spf=pass (domain: linaro.org, ip: 209.85.221.67, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f67.google.com with SMTP id 6so5684330wre.4 for ; Sat, 07 Mar 2020 06:22:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=996MQhbihyUl52mh0TGaksKQxUznfivjqQSJd665ZBs=; b=gzAui6FjFuTmF5O4BoeGp8OpslZ7qW2V2ordtVWFt2s23vnfb8dP2Dm0+as9J9ZLdt Mtv+xxvybY9Vf1szNPDT+HswZOErpl/7ASxIfteoDqnQWQDcSR5fVv1oCa38YPp7n9oY YYkdWTL+AcyFkFhBn7EQsOe7tdqFiCRlkZHBx+Q7ZLwVVFriMHzQqNCmdLrX4XtMu4T+ O2y4ZlXuvqAKOlKf8OMJQ44iGxtHlZ+8XMfkvPBd8HgH4AVe6Ued7vkKSfhOPnaY0I34 7p26UNfvQT/z7LLY1w1prccO+WQgUHDhPNvEDkCRuWzd0xg8qw79RBoIZozGGXuHAGcG NCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=996MQhbihyUl52mh0TGaksKQxUznfivjqQSJd665ZBs=; b=lKdZzcz3q3tnQQPp5c8sq+aPJ/b0kywTI3WIGbJaoBNi/I+ESAiEtc4H+eO9fk2iA0 XRHqTOHzIUFzn/hdfQpMBnmy2qthaahiwNB5QGzlHSmPMpbBMI+s3yy/rN6rUU62Fwst h/e6RD/84mTDbDnsFR4Cy8pQhl07UoGbHBzh6zLN+IZSlBmMpq5HzrtBLJeRIQBCzMKR mN3z5oUGSUeNp/Nk52m93dUKfn1aFjhdvq+rkEma99hOrejmi4l5vb1biJnX+tBFwV5i R0GfcmS7/EJFfPLzjJq9S2hDVYqLi48doqDUtQtcVoIUov/0YIv3zlzwxz3/Pm1uEnyV dHDQ== X-Gm-Message-State: ANhLgQ39o3BtC4mhNxQzT9lDaNtqDacks2JhL9bWHReBmlPt8Y5vQqC9 6swjR1x8khB1Vqf2F7C0AZs+DrtnCQ7TFXxQ2fQAFCn4ZKI= X-Google-Smtp-Source: ADFU+vvnh3y8U60VnRNXqNrh9DMFn67D3UhbWBMmt95rsBcFnDlMoohNJLxTU2Ai/ygwQTolzvrl5nF0pI5hN3r4bdw= X-Received: by 2002:adf:8bda:: with SMTP id w26mr6553325wra.126.1583590945336; Sat, 07 Mar 2020 06:22:25 -0800 (PST) MIME-Version: 1.0 References: <20200306073841.13528-1-ard.biesheuvel@linaro.org> In-Reply-To: From: "Ard Biesheuvel" Date: Sat, 7 Mar 2020 15:22:14 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH] OvmfPkg/QemuKernelLoaderFsDxe: drop tentative const object definition To: edk2-devel-groups-io , Laszlo Ersek Cc: "Feng, Bob C" Content-Type: text/plain; charset="UTF-8" On Fri, 6 Mar 2020 at 20:22, Laszlo Ersek wrote: > > On 03/06/20 17:40, Ard Biesheuvel wrote: > > On Fri, 6 Mar 2020 at 17:14, Laszlo Ersek wrote: > >> > >> On 03/06/20 08:38, Ard Biesheuvel wrote: > >>> Bob reports that VS2017 chokes on a tentative definition of the const > >>> object 'mEfiFileProtocolTemplate', with the following error: > >>> > >>> OvmfPkg\QemuKernelLoaderFsDxe\QemuKernelLoaderFsDxe.c(130): > >>> error C2220: warning treated as error - no 'object' file generated > >>> OvmfPkg\QemuKernelLoaderFsDxe\QemuKernelLoaderFsDxe.c(130): > >>> warning C4132: 'mEfiFileProtocolTemplate': const object should be initialized > >>> > >>> Let's turn the only function that relies on this tentative definition > >>> into a forward declaration itself, and move its definition after the > >>> normal definition of the object. That allows us to drop the tentative > >> > >> (1) s/normal/external/ > >> > > > > Are you sure? The const object has static linkage. > > Yes, I'm sure. > :-) I should have known better than to doubt you on a matter like this ... Thanks for the explanation.