]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/QemuKernelLoaderFsDxe: drop tentative const object definition
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 6 Mar 2020 07:34:24 +0000 (08:34 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 8 Mar 2020 19:45:39 +0000 (19:45 +0000)
commit40d572f70dc10cbacb331c1f0757000195656087
tree31ce6b7f600689d7224a9df8808ab51f5a2dd819
parent80681884319d7ad45987348d30bae60cd3a43afb
OvmfPkg/QemuKernelLoaderFsDxe: drop tentative const object definition

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
external definition of the object. That allows us to drop the tentative
definition of the const object, and hopefully make VS2017 happy.

Cc: "Feng, Bob C" <bob.c.feng@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c