From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web11.7587.1585127562957410587 for ; Wed, 25 Mar 2020 02:12:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=azdnIcKj; spf=pass (domain: linaro.org, ip: 209.85.128.68, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wm1-f68.google.com with SMTP id l20so1585418wmi.3 for ; Wed, 25 Mar 2020 02:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Li7jrWb0cWB/dFtBL5hQytSpDL80C/WIjc2XnoM8/A=; b=azdnIcKjFNjVSQ0iTTUpxUbNcaZ4r6FMS4wAeTxKUfvxxBNZ+pMKga4RioKIGLLYqJ e0o91HMRxeYx+nhyvk5GTHuoAodZ5HEyBifcOtqlEX7+/5DMoseXAFsFE12rE1VpOSu2 FJ6OznwoJ8L5OkjAfpEgpboJ7qI4gpmSkopKprCMYHyc/XxRsonqnt7nEU/OA+F24EXT CKcwAcHGYQX6j6LYsQ0zBidKoOoS2MkGT5ebEuJlBXtCtEr2FjbcTG/aSY/n47Hlxh3k hCGTcz8k1o0nLovvQzGenSDi09z/e1PUqYU8vQkGY01F/lMxg5kfOtvUofmk0dvhSuiC o4Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Li7jrWb0cWB/dFtBL5hQytSpDL80C/WIjc2XnoM8/A=; b=q4F+0vB+P6XSKehwqDzahN/GpfG1Rx5x8ZG4Kn9vjbK39bOQBCeU47rWeeaV7sd1Wn wv2QSZ8EdSlXE7+i9Two/zVA0t1793L55ea6Y3Tg2eyIXLS1AZU29Hzii/JbmKndc7oJ I5PyjzpsFrwBorhEx21RUK+I3iJztDAVs8ozJIX82+r+b5clZHeDxGmdFiTJjpSGWW4w FOnQUUcsghWZhnSfmcBY6ZfjM4mps5Aj/fYND1c7FGAH2txEuEgKXRcs3ER18/svbCAB Td/HJdDa+leOP2DTp5780aCYjw0j/euef22TudlU+PAVI8ZJmUk1nt5EMpnFHTBkCemw Kx+A== X-Gm-Message-State: ANhLgQ2vlcD+nmY8B1BUoqVrwr2qqoNp3McPc47oXHE+FAbdUMv3khbY UdO3x15FACv4Bq2VvhaNqOKPj5l3fxhHVzhW X-Google-Smtp-Source: ADFU+vuimoV/W0HEM24uR7eZIrlZF+DefWtkh0JIUj3VLP6W/EodbYJtnGXhOW4DIhVVji+L0wg/wg== X-Received: by 2002:a05:600c:2dcf:: with SMTP id e15mr2349006wmh.101.1585127561232; Wed, 25 Mar 2020 02:12:41 -0700 (PDT) Return-Path: Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr. [109.210.65.247]) by smtp.gmail.com with ESMTPSA id z12sm34359717wrt.27.2020.03.25.02.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 02:12:40 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: lersek@redhat.com, Ard Biesheuvel Subject: [PATCH] OvmfPkg/X86QemuLoadImageLib: add dummy assignment to work around GCC Date: Wed, 25 Mar 2020 10:12:38 +0100 Message-Id: <20200325091238.24048-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 4.8 or 4.9 may throw the following error when building OVMF: Edk2/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c: In function ‘QemuLoadKernelImage’: Edk2/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c:416:30: error: ‘CommandLine’ may be used uninitialized in this function [-Werror=maybe-uninitialized] UnicodeSPrintAsciiFormat ( cc1: all warnings being treated as errors This is due to the fact that older GCCs fail to infer that CommandLine is never actually used unless it has been assigned. So add a redundant NULL assignment to help these older GCCs understand this. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2630 Fixes: 7c47d89003a6f ("OvmfPkg: implement QEMU loader library for X86 with ...") Signed-off-by: Ard Biesheuvel --- OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c index c5bd6862b265..52b14a4462d8 100644 --- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c +++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c @@ -291,6 +291,11 @@ QemuLoadKernelImage ( CHAR8 *CommandLine; UINTN InitrdSize; + // + // Redundant assignment to work around GCC48/GCC49 limitations. + // + CommandLine = NULL; + // // Load the image. This should call back into the QEMU EFI loader file system. // -- 2.17.1