From nobody Mon Feb 9 20:11:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620408002; cv=none; d=zohomail.com; s=zohoarc; b=CzTXFNFOkI2vlPLQaGkXq9GLaXsIjMCGj9nleU8WpZX9FCqVn1t6psjG12mxsmM1QSXz1XF7YKFehYJ6yeGwQoIDi6+QODrenos4D2nnWOJAI6qcF2555fH2jyLWG0WpBSPf2T3ga9cwZXjCfx9chteFuWczOKAKO8c8pOJzHfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620408002; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject; bh=wOFcyNIJjuiw01s2VBdGQ50UDrGE+IFT929JvHJBSgU=; b=JWvBISWgR20Kf0etkkE0cePY7SAtJXmZB2wmXg5MDaE8VQseYvsWKWEokPgbdfM/PnxM87PFRyDCD3Z6tgzUI5e92TETigAKxRWnBd/7i7VFpmImHYAWY/0EpVGqqsmPIA79bbsIQ6UsLtMf9PhUnwbVPVuCqySyBs2WFToaMMc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620408002209634.7481052426884; Fri, 7 May 2021 10:20:02 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-pioI9-lDOTmyPI8CkwuZ7w-1; Fri, 07 May 2021 13:19:58 -0400 Received: by mail-wr1-f70.google.com with SMTP id n2-20020adfb7420000b029010e47b59f31so1188320wre.9 for ; Fri, 07 May 2021 10:19:58 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (astrasbourg-652-1-219-60.w90-40.abo.wanadoo.fr. [90.40.114.60]) by smtp.gmail.com with ESMTPSA id z14sm10304337wrt.54.2021.05.07.10.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 10:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620408001; 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=wOFcyNIJjuiw01s2VBdGQ50UDrGE+IFT929JvHJBSgU=; b=EFhK/NrqSFg2NQ2sAuH3NNiSqcoYRQJDyLqWMR1X9RRBsM0s4YcWO9WsZ09/B6+fGugw5Y 62ouA/bi01VR7/JhYDuUg0QwVHVfxBgNnZiW15e6zfeY83W/DCsX+3ntStt8YlVMB6GFIJ hZ7fw6tvd1RprX7S/FW4OWmpvuucsuc= X-MC-Unique: pioI9-lDOTmyPI8CkwuZ7w-1 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wOFcyNIJjuiw01s2VBdGQ50UDrGE+IFT929JvHJBSgU=; b=B1Wm721wh5a8OxG5BKCT3WBg6SA8xorjzo0tISQZjy0M6AO6sgD7TTI9hAOzimraPk SK60hqX7ewl9SInG0aLn1CdqrwwZIEoJrsHnmgyhboYhCZTmv5fDEXuveuo2hmxIHFab o/zAX0tz+HcWTQlBgsSmX/33rav1QykA2ZU991OKUHe0zK/Djp1N1NXwDAqgJPMGynUL lRWSrB4VvCbq59pl1x6JrwmdytsBCiaU/OPngi9LYhMIOM72qZc2NGNUWeVCi8judMLW zhSL93we+9oqK2EIfsH1stH8BkUaw6VcKI6kzYWdwYRwKG3pLw4bQqgsvc1lPkXZjADj bwpg== X-Gm-Message-State: AOAM531HN7ZFyP5MOi2XYjC0+TZOsrhOaIFwVuf7JqVBGbnzOCGhMUMP QIirltIPCzQbMGgxUlF8QUz9+bapxK+MmNgIvwRqxldmtR3u9b54F5OyB+4j8gDgkIjDOyUhqiG 4mE11v9T2IpP7Kw== X-Received: by 2002:a05:6000:508:: with SMTP id a8mr13680521wrf.315.1620407997131; Fri, 07 May 2021 10:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwg84xHcRqOfwXcWS/7YUAZoCtC8jV/rXCCK4OED+w2zkmovp5Als6sBpwh/F9cPaEN8+yiqQ== X-Received: by 2002:a05:6000:508:: with SMTP id a8mr13680500wrf.315.1620407996964; Fri, 07 May 2021 10:19:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Paolo Bonzini , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 18/17] tests/unit/test-char: Replace g_alloca() by buffer on the stack Date: Fri, 7 May 2021 19:19:48 +0200 Message-Id: <20210507171948.2062076-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210507144315.1994337-1-philmd@redhat.com> References: <20210507144315.1994337-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The ALLOCA(3) man-page mentions its "use is discouraged". Directly reserve the CharBackend on the stack. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/unit/test-char.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/test-char.c b/tests/unit/test-char.c index 5b3b48ebacd..54ce26226b3 100644 --- a/tests/unit/test-char.c +++ b/tests/unit/test-char.c @@ -574,7 +574,7 @@ static void char_udp_test_internal(Chardev *reuse_chr, = int sock) struct sockaddr_in other; SocketIdleData d =3D { 0, }; Chardev *chr; - CharBackend *be; + CharBackend tmpbe, *be =3D &tmpbe; socklen_t alen =3D sizeof(other); int ret; char buf[10]; @@ -590,7 +590,6 @@ static void char_udp_test_internal(Chardev *reuse_chr, = int sock) chr =3D qemu_chr_new("client", tmp, NULL); g_assert_nonnull(chr); =20 - be =3D g_alloca(sizeof(CharBackend)); qemu_chr_fe_init(be, chr, &error_abort); } =20 --=20 2.26.3