From nobody Fri Dec 19 06:16:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620632518; cv=none; d=zohomail.com; s=zohoarc; b=SIxe13kBglvFGo0OEVwsIJpqGi9Wxmc0jT0OiJ/xx6nssPA6A9sSjLl+J6OFkNfQKoMiii063hY/AwPD2MR8ZIVpbueeOP77GuBU5Shr+jEgSLbdlCoQsV5YlqfevFhSMs2Ku03f+uJFulB/dzCIqGV6jnMcMA8qqsDabCJI7yY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620632518; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5Hqvo+WY3MUa5q507SiS1jOkZQ1tc6z1XQjaNlbeT40=; b=hMlxVxvUknCBrPkG79fHtBYw1eruKekWgAsPkn3JD9i3LOD8tNlN3jk4Z5ae6FdKbahQjLH93GJlKkC+k1x7ZnyeQp+mepLQs1ydt+Ovnqng9OXQeLcVKaAkuDVTUDBLbWkomLZon9w7CpUhF+cpWxA5a+1eIAARbGp6KHv+lww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620632518083835.2311122466213; Mon, 10 May 2021 00:41:58 -0700 (PDT) Received: from localhost ([::1]:39034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg0Y9-0007F9-2T for importer@patchew.org; Mon, 10 May 2021 03:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg0SJ-0001dI-PI for qemu-devel@nongnu.org; Mon, 10 May 2021 03:35:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg0SG-0003lo-Sh for qemu-devel@nongnu.org; Mon, 10 May 2021 03:35:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-KKC6EEdRMwCOd_PjqsJEEA-1; Mon, 10 May 2021 03:35:47 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9850C8BEDA3; Mon, 10 May 2021 07:35:46 +0000 (UTC) Received: from thuth.com (ovpn-112-84.ams2.redhat.com [10.36.112.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2CDFE154; Mon, 10 May 2021 07:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620632152; 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=5Hqvo+WY3MUa5q507SiS1jOkZQ1tc6z1XQjaNlbeT40=; b=KfLtVZeJVf7IoaVfd/yQOSXcgKEV/VzYW3/FO/wKidhWwvDmL5OOB1/o8o5mIWoAkvz9Fa 5qnSV109mIyfdS7f09wjFxVJIJ4pTpxpnE0AV59FbbYYV8iA8TS2NI4I1nFzdYUt4Zd4BC N2K1xGpXw2hW6ZZtaFtV6bUK5ZiyCM4= X-MC-Unique: KKC6EEdRMwCOd_PjqsJEEA-1 From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 7/9] pc-bios/s390-ccw: Silence GCC 11 stringop-overflow warning Date: Mon, 10 May 2021 09:35:22 +0200 Message-Id: <20210510073524.85951-8-thuth@redhat.com> In-Reply-To: <20210510073524.85951-1-thuth@redhat.com> References: <20210510073524.85951-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , qemu-s390x@nongnu.org, cohuck@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 When building on Fedora 34 (gcc version 11.0.0 20210210) we get: In file included from pc-bios/s390-ccw/main.c:11: In function =E2=80=98memset=E2=80=99, inlined from =E2=80=98boot_setup=E2=80=99 at pc-bios/s390-ccw/main.c:= 185:5, inlined from =E2=80=98main=E2=80=99 at pc-bios/s390-ccw/main.c:288:5: pc-bios/s390-ccw/libc.h:28:14: warning: writing 1 byte into a region of s= ize 0 [-Wstringop-overflow=3D] 28 | p[i] =3D c; | ~~~~~^~~ The offending code is: memset((char *)S390EP, 0, 6); where S390EP is a const address: #define S390EP 0x10008 The compiler doesn't know how big that pointed area is, so it assume that its length is zero. This has been reported as BZ#99578 to GCC: "gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a pointer from integer literal" https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99578 As this warning does us more harm than good in the BIOS code (where lot of direct accesses to low memory are done), silence this warning for all BIOS objects. Suggested-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210422145911.2513980-1-philmd@redhat.com> Acked-by: Christian Borntraeger Message-Id: <20210502174836.838816-4-thuth@redhat.com> [thuth: Use the pre-existing cc-option macro instead of adding a new one] Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index f0fe84c9eb..83fb1afb73 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -30,6 +30,7 @@ OBJECTS =3D start.o main.o bootmap.o jump2ipl.o sclp.o me= nu.o \ virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o =20 QEMU_CFLAGS :=3D -Wall $(filter -W%, $(QEMU_CFLAGS)) +QEMU_CFLAGS +=3D $(call cc-option,-Werror $(QEMU_CFLAGS),-Wno-stringop-ove= rflow) QEMU_CFLAGS +=3D -ffreestanding -fno-delete-null-pointer-checks -fno-commo= n -fPIE QEMU_CFLAGS +=3D -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tab= les QEMU_CFLAGS +=3D $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector) --=20 2.27.0