From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.30556.1583658089228257830 for ; Sun, 08 Mar 2020 01:01:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eLDC1fKx; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583658088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Qz6ZDwMewQ/fsWXITa2Sy3+QYc8LN+F1WvbdTBPPQk=; b=eLDC1fKxuy0UBJ2KTEIWRLTGLaljkYs/569lyBc9lK/iy0x74ts2vG0tqqTv6D5uZ99Dci ZObs/QWcDY08E0D36gCcDYmeAragf6yDbX4fWSbljt3qLsqns6Xr9pEsmDcjHfCkGY0UfV dSxPKe384wg4bV2+kj9excGpQ/rnvL8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-X1Z91wEePeyRKpOQf1oZyg-1; Sun, 08 Mar 2020 05:01:26 -0400 X-MC-Unique: X1Z91wEePeyRKpOQf1oZyg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6231B18A72A2; Sun, 8 Mar 2020 09:01:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-62.ams2.redhat.com [10.36.116.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9811D5D9CD; Sun, 8 Mar 2020 09:01:24 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] OvmfPkg/QemuKernelLoaderFsDxe: drop tentative const object definition To: Ard Biesheuvel , edk2-devel-groups-io Cc: "Feng, Bob C" References: <20200306073841.13528-1-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <131309a1-bf24-b917-db10-e38d6d37eddf@redhat.com> Date: Sun, 8 Mar 2020 10:01:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/07/20 15:22, Ard Biesheuvel wrote: > 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 ... That's very kind :) but I do need to be kept on my toes! > Thanks for the explanation. > Thank you, Laszlo