]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PlatformBootManagerLib: Fix gcc-4.8 Ia32 build failure
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 3 May 2016 03:05:36 +0000 (11:05 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 4 May 2016 00:47:44 +0000 (08:47 +0800)
The Width and Height assignment suppresses an invalid gcc-4.8 warning
on Ia32.
These warnings look unjustified to me. Namely, near the beginning of
the function, there is a while(1) loop. In that loop,
ConvertBmpToGopBlt() is called unconditionally. If the call fails,
the rest of the loop body is not reached (where the Height and Width
variables are used -- the compiler warns about their use in the
switch statement). If the call succeeds, then the variables are set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c

index dd475adf3eef28319e77887ccc159e639deb2889..972050fa9cc73a9603d2f7011ec8762d9a0c3b05 100644 (file)
@@ -361,6 +361,8 @@ EnableQuietBoot (
   NewHeight = 0;\r
   NewWidth = 0;\r
   Instance = 0;\r
+  Height = 0;\r
+  Width = 0;\r
   while (1) {\r
     ImageData = NULL;\r
     ImageSize = 0;\r