From c6910aeda330c9d1b6b1153da430f946c575b4f5 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Fri, 10 Jul 2015 06:46:57 +0000 Subject: OvmfPkg: QemuFwCfgLib: avoid "variable set but not used" warning from GCC The FileReserved variable in QemuFwCfgFindFile() is only used to skip over the reserved field in file headers, which causes newer versions of GCC to flag it with a "variable set but not used" warning (which is normally not visible since as of right now these warnings are supressed). It's true that the value read into FileReserved is never used, but this is intentional. This patch adds a do-nothing reference to silence the warning. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bill Paul Reviewed-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17920 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 24424f83a9..5c96d2af25 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -283,6 +283,7 @@ QemuFwCfgFindFile ( FileSize = QemuFwCfgRead32 (); FileSelect = QemuFwCfgRead16 (); FileReserved = QemuFwCfgRead16 (); + (VOID) FileReserved; /* Force a do-nothing reference. */ InternalQemuFwCfgReadBytes (sizeof (FName), FName); if (AsciiStrCmp (Name, FName) == 0) { -- cgit v1.2.3