From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web12.9906.1648123485990883808 for ; Thu, 24 Mar 2022 05:04:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NhQQ6AVR; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648123485; 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=bhFjcV/glD6yu+Mc/KA6E/3eu+oDeYwZHV1aK2Gau5Q=; b=NhQQ6AVRH5b6iTIJTPVuAf+YrT5PU2oFcCNUqCa4FBSfz1x8w4CnhZwrVmc7zPhsNSAKu0 ouj2Kw3VIvx/KBL+bzaJn6FqU9kw7wMLBeKA24mOQv29U/tKsEdymX9X99ZmkDljuo3Bb8 yRuK1Zy1XzJx9qZSxCCS7FewzJOwXz0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-Nv1heSrrOdCUixCj4Y3oCA-1; Thu, 24 Mar 2022 08:04:41 -0400 X-MC-Unique: Nv1heSrrOdCUixCj4Y3oCA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4F51629ABA28; Thu, 24 Mar 2022 12:04:41 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.196.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CDA3C27E93; Thu, 24 Mar 2022 12:04:41 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 56AE51800617; Thu, 24 Mar 2022 13:04:36 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Liming Gao , Yuwei Chen , Oliver Steffen , Bob Feng , Gerd Hoffmann Subject: [PATCH 2/3] BaseTools: fix gcc12 warning Date: Thu, 24 Mar 2022 13:04:35 +0100 Message-Id: <20220324120436.939688-3-kraxel@redhat.com> In-Reply-To: <20220324120436.939688-1-kraxel@redhat.com> References: <20220324120436.939688-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sdk/C/LzmaEnc.c: In function ‘LzmaEnc_CodeOneMemBlock’: Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ‘outStream’ in ‘*p.rc.outStream’ [-Werror=dangling-pointer=] 2828 | p->rc.outStream = &outStream.vt; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ‘outStream’ declared here 2811 | CLzmaEnc_SeqOutStreamBuf outStream; | ^~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ‘pp’ declared here Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ‘outStream’ in ‘*(CLzmaEnc *)pp.rc.outStream’ [-Werror=dangling-pointer=] 2828 | p->rc.outStream = &outStream.vt; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ‘outStream’ declared here 2811 | CLzmaEnc_SeqOutStreamBuf outStream; | ^~~~~~~~~ Sdk/C/LzmaEnc.c:2811:28: note: ‘pp’ declared here cc1: all warnings being treated as errors Signed-off-by: Gerd Hoffmann --- BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c index 4e9b499f8d80..4b9f5fa69248 100644 --- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c +++ b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c @@ -2825,12 +2825,13 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, nowPos64 = p->nowPos64; RangeEnc_Init(&p->rc); - p->rc.outStream = &outStream.vt; if (desiredPackSize == 0) return SZ_ERROR_OUTPUT_EOF; + p->rc.outStream = &outStream.vt; res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); + p->rc.outStream = NULL; *unpackSize = (UInt32)(p->nowPos64 - nowPos64); *destLen -= outStream.rem; -- 2.35.1