From patchwork Thu Apr 11 10:43:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787953 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157241wrm; Thu, 11 Apr 2024 03:44:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVFxw8i5/xC9rzHrr83Xynasx5b02tlQldHYX5LNiqQqjVKiwL50zwTDooLBBl7GkP7xOpgt0ody2iuJxDZoaFT X-Google-Smtp-Source: AGHT+IGnnld4Skq6inR8QffS09pDYS4BZYz1YB3zbGrlnnw6vgvBFxZGTBObxK6mFwzlU8G3ic+G X-Received: by 2002:a37:e101:0:b0:78d:7738:67fb with SMTP id c1-20020a37e101000000b0078d773867fbmr5198198qkm.11.1712832294823; Thu, 11 Apr 2024 03:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832294; cv=none; d=google.com; s=arc-20160816; b=O5tNKcjLUE16r28PN0sq7DgRZZbjWhk4DAKzxbk5WgqCTWBl+jOSQkUIQJ/8YBbyQg KZPc8DKJaXiabrtX4yo37q4GZ3tgB30MxaGhDhoJCD3lkOClI3hlIATpxrCyEDzc1oJ3 +u5Xk/OVM7emR8k9TSkAB1kObeH59/hJhvRmMPdPbir6aFZoTpkfpjOJU61toXKsjPbA ImDwM1Arhv0WAZiwAm3CsZPhyKvdW7jO8V39OCODQ/Zp8l08wf7SQF4ytkPq4dO8U2Lo oaTsL2BsTjXruzPkoWvfrM+Y/mjaPpuZhBJxvgw2AnFu4mrxXk1nd77BsTEWjAf/c70q cbeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u3g1QSRg86bxVtcxnKKn01h0Ac3fWVT80PO+fMEEjTc=; fh=zddFdJsj323aRCRVsCQ7JYw2DAFyzl89eLvTLFSIJpA=; b=VBHzRzGcMG3lj0y6eiT0xxdo+j+46GFc4OcwX+ipjnTncbERPoXMBsHqEGic9GIYjA O0smgkrWLW562llUnu2YSnfqj+zGuld4yCchU4hXfZi6/zJaMgXBHCgVjY/jivy+Wc0o 6Y2+r4zcvex0Z1ztxnDqgAr1tzwANDZY+KJxJGulNcMpF2lDZtwqVrAfCs/yOj691ICe VV+W19zEBYvLaJgvpxsYe+sALEXqiLZ6rOrx1cZY3ZwKuKUfDLgXxHkymRpIaifGTSij Qs8yl0TDYcJd7k/MiupqtLji3IWqma7sMRrmDemUcozLK5X7Usisn7u+GL4ut5Zztt99 GvqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ujZpLNuG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id wx12-20020a05620a5a4c00b0078d39c48240si1232273qkn.237.2024.04.11.03.44.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ujZpLNuG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruruM-0002lt-VX; Thu, 11 Apr 2024 06:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruL-0002kv-A1 for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:43:53 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruruI-0004BG-T3 for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:43:53 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-343f1957ffcso449401f8f.0 for ; Thu, 11 Apr 2024 03:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832229; x=1713437029; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u3g1QSRg86bxVtcxnKKn01h0Ac3fWVT80PO+fMEEjTc=; b=ujZpLNuGHK2mgdbNq1+2c8R/e0NYK1eJuktMVqdvKiJhiB4WtUPEa8yu1DKTX9KJu6 iH3B8pl8mwtJE3vId/+Xvaz9Eyy53LyIZLniC92hpKueuIJ9gXidZVC+yYgSSS6SzpfR HHPINm0UkW+MKIFrPbo+M0FriOEdFfbvIDWpoSAPMiqq8/iOUcrsV8i+tYCvQNX+/8sC DQu4PnehSbTywx1gtfTnnqFRQ2T2teeXLgdQ0+1b5C048d8GuPevS1kigPRLqteMFuQB +ob8Y0yH/Q8fvaWpcAEKS+ZpHNraGxM6Ns7yTXb5LoNRzsPBIM6W1zEwKo/zQwqNlVA9 9izQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832229; x=1713437029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u3g1QSRg86bxVtcxnKKn01h0Ac3fWVT80PO+fMEEjTc=; b=lnqLnH+DVk+XUbVSpQq82dR3GpK1VSEiPefytIDHou9A3d+GRwBah3XR2YcahcshD/ 06plHmXgqDiTQeuvzXVCWhUHY7f/LA9TOgceO5KqdYkIs3QmJK0f71w0cpllzOp0hZWG XbJEou2fql09EkOIrxJGcOkdKNgPqWnUBN4LD2vET+ZwmiPoLGaWkeMfXclMpxGp4A17 9d1Xk//MiDWql/eK7Zue/49rAqxBwZfTWRVo/oIqH1vKoFnH0VOgkE6rmMRYcNLjjTma ono1yGd9ISfqnrl7C91TcukeHWrLhDJugbcc5L/WOv06PaihUrRVIfQ++RmMQZGWL6IR rkfw== X-Gm-Message-State: AOJu0YywRDbbczg9elMXAWq4Y7PrR9elTfuMxnmg/q46JDf4458/SlPr +YX4Lkz5CfihNPfOHTqB9nV/4FAp0VJ1F4h+2B/MMdj3d2GaROfHOoMBpsiEllXClkBFvvnN6Q3 n4kE= X-Received: by 2002:a5d:456d:0:b0:346:65dd:5580 with SMTP id a13-20020a5d456d000000b0034665dd5580mr1693002wrc.3.1712832229124; Thu, 11 Apr 2024 03:43:49 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id m5-20020a5d6245000000b0034334af2957sm1469250wrv.37.2024.04.11.03.43.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:43:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Laurent Vivier Subject: [PATCH 1/9] disas/m68k: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:32 +0200 Message-ID: <20240411104340.6617-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- disas/m68k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disas/m68k.c b/disas/m68k.c index 1f16e295ab..800b4145ac 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1000,7 +1000,7 @@ print_indexed (int basereg, /* Generate the text for the index register. Where this will be output is not yet determined. */ - sprintf (buf, "%s:%c%s", + snprintf(buf, sizeof(buf), "%s:%c%s", reg_names[(word >> 12) & 0xf], (word & 0x800) ? 'l' : 'w', scales[(word >> 9) & 3]); From patchwork Thu Apr 11 10:43:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787957 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157731wrm; Thu, 11 Apr 2024 03:46:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUaWIsqQwfqU9y/CTB9kXFyuZkJC7TonwkYtsc0wfypWbbJX/9QcX8Ws65Q6jXRuxIlbnuWQJRozeyMkUn7oduv X-Google-Smtp-Source: AGHT+IGaSBLbn/cwqNJ/AQo8EsJ8GDUu3UJvIeXdc+a99LRNsCaqZUb1wKc2+onTNq2sO+CNygr/ X-Received: by 2002:a81:8a06:0:b0:615:48c5:f6a8 with SMTP id a6-20020a818a06000000b0061548c5f6a8mr5180154ywg.47.1712832377868; Thu, 11 Apr 2024 03:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832377; cv=none; d=google.com; s=arc-20160816; b=JqKfzKi1+tcpqN+NQOXcKc70KV+2bK5uB1Yn8C7ZJM0a8aOYGRqjjWkpWc97z8nOG7 iA3JTmnFgVQEV3uJJDoiSVAErCEA5w+0AlePnEH5HBBe6O9hlxREZSE1/BrWjQSw0xhv WRbP8NEur901Wn1QpcA65g763hHAkBjC65Ai8Rg+Tk72B1xQ4tNZVmNbKda1cHYliZ75 +j+0eCINFiDnBKDZe4lapkjvbUSBa7CvbbtaQjqFsBnuRQtPLbkGV5/TlcITAjzeY9dL fWk92pZoddCILaZg7UJl2uQTuvZWDcnso8MI8UI00thdnO3LxanEN5yHw6BBWo6D0yDK Ktmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZARctQBaWTgi16Nsw9jDwGPNb4MI5ibxpQ1TfC8D7e4=; fh=+59ao9oSc1SGxUJzhUa1UnjN6q33SXhEw+bkPs4Onpk=; b=k1TNKbG684jTyoHL7SeglHUFwvlEz8CxCNSd7mQ2m/UZ8Rukeh+yRnFujVc1uXVmEp WpNxcBYVlrkWxnR9X8YxULIpByiwYoUPlSKbIGXsmbBJMS2KnwwTx7ZOBTHI+hd77ZZ9 hG4Crq1lJYgEay7JS7F8pYS+02LbNEKboFjX8CrsxZ4W7TBir0PUMUSmZuLbz+At0Coq ohEVeWlJUEFHXY+q/k5+fwijoZLWbkhjfph+vDPwgmDRkMs8TXDWlKCD1curbt1035/c Hokgvy3XkpLdWi5HU5eumvF5RQXsOIa1b762V/URkj1cD+2IBK7/ILW53NR3BfurFnh/ xhJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uyq3Zvys; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ye19-20020a05620a3b9300b0078d63a51632si1216433qkn.565.2024.04.11.03.46.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:46:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uyq3Zvys; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruruS-0002ne-PT; Thu, 11 Apr 2024 06:44:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruR-0002mv-4l for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:43:59 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruruO-0004Dv-Cd for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:43:58 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3458b699d6cso2049759f8f.0 for ; Thu, 11 Apr 2024 03:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832235; x=1713437035; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZARctQBaWTgi16Nsw9jDwGPNb4MI5ibxpQ1TfC8D7e4=; b=Uyq3ZvysZVVtHJqCKPc03g5Bsc5oinb0hXgKU+H4K5AlZ/8HcxFapInf8Z4Bz1ShGO 8KmPGbqO+fb3KLveXljBwmkqj4Zhu++jDyU5Tu6syvG3RWsQnxyOmqinSOEnHHwL90Ik SMugQiXDytI8bGOe3zaB3YhaWDdnITY+oSdm5/YHxG4v3Nyemr8sod6Qoz3r9tF0wJtN U83nfCBILtZ3labYAJlxnxic6UZaC2qjBD3SI0zVAArDrRc9RdqQ4dVWlKacV04vQ1u2 /1wZSEAcw9YeJ+mxq8/U+4CqZyJrN09hHIyo4laihz7i/96ptAHxUQkcOoh6Hmo/IooK zbmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832235; x=1713437035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZARctQBaWTgi16Nsw9jDwGPNb4MI5ibxpQ1TfC8D7e4=; b=JsI8bvXcX7R6r1cJjYzqFIKTu0e8FNs3Y/r3gzGRGhyk5ZAinIqpWXJIf+4sPWQyAJ A+yOLTNabaY9kuU0wQAqSSgVrO2CYGkP5/u7m/rM7eQFUB+zqJv1OVbP/0Ya0fFpyAew X0Tzitw/c8IjTs0chsMDKyC1i94KczyWnjhYdwEEtYzA0VtpCP1Gjx9dDzA8syFZScAe fAO1krS664BQpksL5CJobr3ilQpvKoz5qxlnhw/5/Lplrwzu0M4razE/F6wlwJTsQ5IE PsmiLBUF7+DjPpupQCFhFVChG5Nc0eJmCAf6jSJnoQLDvbifvRQtYhPn1e+1kYgWzqfn t5jQ== X-Gm-Message-State: AOJu0YxYmRUXB8TN+a46QR/AHtaekBH3sjFJp4xmXi/Uc53KrimsU7SS cNIzyRTTTUPBCGhWYomkh3BpPm7/utww69UA2sjpqgg8mTE93vq0MYo8ECpjYDR3DeU1WxcTldb CxSM= X-Received: by 2002:a5d:58c2:0:b0:346:ba70:f261 with SMTP id o2-20020a5d58c2000000b00346ba70f261mr952868wrf.2.1712832234836; Thu, 11 Apr 2024 03:43:54 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id t7-20020adfe447000000b00343eac2acc4sm1461921wrm.111.2024.04.11.03.43.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:43:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , "Edgar E. Iglesias" Subject: [PATCH 2/9] disas/microblaze: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:33 +0200 Message-ID: <20240411104340.6617-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- disas/microblaze.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/disas/microblaze.c b/disas/microblaze.c index 0b89b9c4fa..49a4c0fd40 100644 --- a/disas/microblaze.c +++ b/disas/microblaze.c @@ -600,7 +600,8 @@ static char * get_field (long instr, long mask, unsigned short low) { char tmpstr[25]; - sprintf(tmpstr, "%s%d", register_prefix, (int)((instr & mask) >> low)); + snprintf(tmpstr, sizeof(tmpstr), "%s%d", register_prefix, + (int)((instr & mask) >> low)); return(strdup(tmpstr)); } @@ -608,7 +609,8 @@ static char * get_field_imm (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (short)((instr & IMM_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (short)((instr & IMM_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -616,7 +618,8 @@ static char * get_field_imm5 (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (short)((instr & IMM5_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -624,7 +627,8 @@ static char * get_field_rfsl (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%s%d", fsl_register_prefix, (short)((instr & RFSL_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%s%d", fsl_register_prefix, + (short)((instr & RFSL_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -632,7 +636,8 @@ static char * get_field_imm15 (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (short)((instr & IMM15_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (short)((instr & IMM15_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -641,7 +646,8 @@ static char * get_field_unsigned_imm (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (int)((instr & IMM_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (int)((instr & IMM_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } #endif @@ -653,7 +659,8 @@ get_field_unsigned_imm (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%s%s", register_prefix, (((instr & IMM_MASK) >> IMM_LOW) & REG_MSR_MASK) == 0 ? "pc" : "msr"); + snprintf(tmpstr, sizeof(tmpstr), "%s%s", register_prefix, + (((instr & IMM_MASK) >> IMM_LOW) & REG_MSR_MASK) == 0 ? "pc" : "msr"); return(strdup(tmpstr)); } @@ -709,7 +716,7 @@ get_field_special(long instr, const struct op_code_struct *op) default : { if ( ((((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) & 0xE000) == REG_PVR_MASK) { - sprintf(tmpstr, "%s%u", pvr_register_prefix, + snprintf(tmpstr, sizeof(tmpstr), "%s%u", pvr_register_prefix, (unsigned short)(((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) ^ REG_PVR_MASK); return(strdup(tmpstr)); @@ -720,7 +727,7 @@ get_field_special(long instr, const struct op_code_struct *op) break; } - sprintf(tmpstr, "%s%s", register_prefix, spr); + snprintf(tmpstr, sizeof(tmpstr), "%s%s", register_prefix, spr); return(strdup(tmpstr)); } From patchwork Thu Apr 11 10:43:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787954 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157242wrm; Thu, 11 Apr 2024 03:44:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWPhjd12K29rEIyrc0m411MnuYDYoM4EDIyl8xHg6LZ6634z68wLO/ZRsdBvRTq9Qo2C2Mubs9KGDJs9gnooEaD X-Google-Smtp-Source: AGHT+IF6tbQjOLqBAusmtecVFl+ngJbaaOv3BwU7g2jYM0Cl3/GqOZwOx6UcfEAHBbyWoJlbWXwo X-Received: by 2002:a05:6214:c2e:b0:699:2cb6:8583 with SMTP id a14-20020a0562140c2e00b006992cb68583mr4973440qvd.5.1712832294766; Thu, 11 Apr 2024 03:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832294; cv=none; d=google.com; s=arc-20160816; b=zpF6mttYYHCtrV7RUjTuUXcCkHzmgudygYB+3+rp9sou+BhqEd2RJvcvoEUzu43zIr /wlUh63yuifKlCPi9ZluRGrMexT/dAlh6ffOwENJcKNyfc0RdTJW6tbmVZN28qronFZC MhCqZWxeE8o0myV+DPEmKW18UTHbMGXLlCI24trLDK9kDckEzFKEg7LglMLNGRkpP0uH 51irUlVI60799elewf/GFjTsZPArEXaPmLPsoLcBqQz8Ay67rV7tcDV20yxbeyloidDC uWt2Q+qGAVgeXsd6o1IeGHfaGcphY7QtHMIB/CFT8rYyOffAN/swNEfiLsJnKdDdGUWd b5Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eBldt31TQRcaP3wXP9WMxXOJNX8RudxIC5CYlIBA8B4=; fh=MBJlJCn333aYOd1EUTDtKgqxaoON7mhnhIa3ytF7n60=; b=PEIPMYYUVIH1M1SF0toYMOpjxmM7IOd9xvb7QfuPr6E6B7pQrHhP+NRTlwsvOFVcDM BJhJEvUhI3g46xhvRhpS2aJp+Hxb5uV/Sgu9lVvRb5wvXy8sRo99qALlIVpSWqCLOTQL a/Y0BVmK+n70QQa2X91tpFNX4jmaATd0CA+AILr6P6wB7qJs4Dc42x65v92pzrHMJREF qeMYhNczHmTjxC4094cUiRr3l5nvwfnfdpRvyDxCwAV7cgYp0JCY7gIfN9ibopUsg0C1 RPVd/CWN2aV0TWvuqhw0HJqGwKg5PEoclIxXdWmwTKKHfSZblLl2WrR5iRzLk0w3a9mh SwvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QIGlN3Go; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qd2-20020ad44802000000b0069b4f5ec7d1si533727qvb.611.2024.04.11.03.44.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QIGlN3Go; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruruX-0002oL-JU; Thu, 11 Apr 2024 06:44:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruV-0002nx-TJ for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:03 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruruU-0004GV-DA for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:03 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-417e327773cso1601435e9.1 for ; Thu, 11 Apr 2024 03:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832240; x=1713437040; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eBldt31TQRcaP3wXP9WMxXOJNX8RudxIC5CYlIBA8B4=; b=QIGlN3GoWfotiLT8p59Mbl8d/yjYxdPX5UhHMTw2ElgLAEK1CmaXOR8OWpYvIvpiXR pI/icNE4dRlY+pUypjHplgUDoJoW00AZLoTKUclaljRXgKOwlZYPcuF23eS5ezZN8lx1 RhylBSH7BWRq3gcsGgHh1ccF5i95BFYs/+0i9q0uTBg+MrRkpIwif4PziZI5hYBJqzhn KCGaBiP2HMFMC/x4eGh1i9hFP0zybIH9FJPh2iO+JD4xgz3EyVnndIbOnk9fNgndIGhS 7DEWZmbH69T4nSOkDkcehkkruszKn6GKeVk8azFmBc0heNfZUP20bvg6+YJZshGBf4ko 9yVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832240; x=1713437040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eBldt31TQRcaP3wXP9WMxXOJNX8RudxIC5CYlIBA8B4=; b=JssX6bKMXetyGgNjajfyOzebGe5H33FD35HBOBaU0Zp1W9ZGxOLryUSi+BRjAmYDIk 4MsThzVCaTrx7oY3/AkMH+ngteeXsnaH2DLTZbNBjChP/Hg2vSTr3eRt1/E8ZwzOgYhn qKGDjED84xWcMeHLfwbjEHRZUNUMC3N15pD8aTtfOVRKjXSoTskpG8FG58G9HyZdfRRx n9JVnRrYRYH1ozgwod9VpIiLvt/jLn0E3sLCIQ9SmiXGAXErlEjlEeRItdj97ff+wht7 37ZompqPOaGKlBBd3oO8i6LQap5+73r9vumHhbPx+AFNmvPxRY1EWqM5hx8Lcb+g/VIb Jujg== X-Gm-Message-State: AOJu0Yx0741RaEKlTpbyLbHQxm/h73aH/Gs7KFeKs9oOa0RcsIgiByJr CNM8mji+BAbhAs7N+IDY8e+QLhgvvbrlYiLjrQglfjaNXxTib9Z/KP2JGM/KlIEd137y4QWoLAg 18uM= X-Received: by 2002:adf:fb43:0:b0:346:41a7:2fc2 with SMTP id c3-20020adffb43000000b0034641a72fc2mr1924813wrs.32.1712832240706; Thu, 11 Apr 2024 03:44:00 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id k9-20020adfe3c9000000b00344a8f9cf18sm1481628wrm.7.2024.04.11.03.43.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Palmer Dabbelt , Alistair Francis Subject: [PATCH 3/9] disas/riscv: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:34 +0200 Message-ID: <20240411104340.6617-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- disas/riscv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/disas/riscv.c b/disas/riscv.c index e236c8b5b7..fec09e9922 100644 --- a/disas/riscv.c +++ b/disas/riscv.c @@ -4966,7 +4966,7 @@ static void format_inst(char *buf, size_t buflen, size_t tab, rv_decode *dec) case 'v': { char nbuf[32] = {0}; const int sew = 1 << (((dec->vzimm >> 3) & 0b111) + 3); - sprintf(nbuf, "%d", sew); + snprintf(nbuf, sizeof(nbuf), "%d", sew); const int lmul = dec->vzimm & 0b11; const int flmul = (dec->vzimm >> 2) & 1; const char *vta = (dec->vzimm >> 6) & 1 ? "ta" : "tu"; @@ -4977,18 +4977,18 @@ static void format_inst(char *buf, size_t buflen, size_t tab, rv_decode *dec) if (flmul) { switch (lmul) { case 3: - sprintf(nbuf, "f2"); + snprintf(nbuf, sizeof(nbuf), "f2"); break; case 2: - sprintf(nbuf, "f4"); + snprintf(nbuf, sizeof(nbuf), "f4"); break; case 1: - sprintf(nbuf, "f8"); + snprintf(nbuf, sizeof(nbuf), "f8"); break; } append(buf, nbuf, buflen); } else { - sprintf(nbuf, "%d", 1 << lmul); + snprintf(nbuf, sizeof(nbuf), "%d", 1 << lmul); append(buf, nbuf, buflen); } append(buf, ",", buflen); From patchwork Thu Apr 11 10:43:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787961 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157974wrm; Thu, 11 Apr 2024 03:46:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhxidJon/qsS4s/2QCeGHrNWsOOMyBnTn+sn4cgASxzXjxvFUI2EOhjnYNM4bWc7eeRhBs2wL1S1Ta7FTb5svz X-Google-Smtp-Source: AGHT+IFEmt3oa6rNlu2cIOCRYNfEWkTCaKtZ3G/x0HunRV34X1deNovRMI3/mpfsvTDx7p/FQzkW X-Received: by 2002:a05:6214:e4f:b0:696:b2bd:759f with SMTP id o15-20020a0562140e4f00b00696b2bd759fmr6440549qvc.25.1712832418926; Thu, 11 Apr 2024 03:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832418; cv=none; d=google.com; s=arc-20160816; b=Nlzr0pJ87gXf0cYaA9rzrP3d7TUHFXQ7x7wM+79tW6RUd5rqlk49RzK4/+bo4Wpnn6 zjSpEeozzDkZqIcu5O55khDGx/PllBRojuh0THwmZja2VzEy7+l1X99RrCFLLhpfwl/W w7LZMHyXNGtGnwl8tpwgszcJsO6Y2wRIxxkmH+suW0czw4yOfte8H8FS+YQcQ/b1HuO3 WO4b3/ZOwrMkucWanHusSW7n74owSWHHlQXPK4v3AdifVrd0hSgNOlj4ZiDtIO5mNMUW H1Jr/nv8DQaq0odK6a9r+Trr6c5LTUXZg9qQyb2WkZuQxMz3WTp5oWs+W6sRtmX0gw2a LXeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+zSTvPGfcRjEBEVqiYMcCOTilCqnhe5Ojdjg6D66FBk=; fh=zddFdJsj323aRCRVsCQ7JYw2DAFyzl89eLvTLFSIJpA=; b=S/t9mmuRK+kZJ6kfjdMsi/otKoy37YcqXsNnY7WsyqlaFKG0w33iqgGPNVRO5Pjf5d +g9dzgnKr2EnwVJVTcL9kqiBq3q7xHN8IIhDEHeejINYXUOsN64hOn1juakfEcP9wS7S a4A95CsUmx1OTWpalELsFkCjkeHTbCnv2MKunAqWTeU3kU2LP+IGsezyRHYfxtErzCxr pmDYFu7E40V8+89dbohd8lGNfSWrtQvg7DnJ6Qdetnm7Kb6KeO37i2m9yBWPmf4MBJ+1 UxtE6ezFTxDl+GOo47B+doEhkaXZVaOKj/UPO1dm/wTS9BVat+10i8ck1gOlcugURxJb NkAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/IYJVI4"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c9-20020a0ce7c9000000b006967e455b44si1214699qvo.352.2024.04.11.03.46.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:46:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/IYJVI4"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurue-0002vD-4F; Thu, 11 Apr 2024 06:44:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruc-0002t4-PJ for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:10 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurua-0004Ip-3i for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:10 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41551639550so53105795e9.2 for ; Thu, 11 Apr 2024 03:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832246; x=1713437046; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+zSTvPGfcRjEBEVqiYMcCOTilCqnhe5Ojdjg6D66FBk=; b=g/IYJVI4TbLIZNWEaOtyNXFOaUJQriPR0NuDWqHXF562W7r8h4uT0kewQ7GjUp2IpN CmwWDW7PcUt+mtLAC7j2Q8gDGXZhqEPq1h9rIL6i2To4e/if2r6MeRhDg9RRXK35NPyi xRuDCX7F/YKJN/pfv+7vKnNpK2ux6Y8tuFqkicRazqn5uK28h5BdYhBZyXP6rZY3r8N5 ZrUx3BBHF9DkkVh9Gm67H+AuPHXtQSROCq1rfLtLuiyTyCF1YUBBePMlbWBYyPfP/fza KTcs1+TPCi+PVEzso55hM0FKUFSgtDXAex9C9tHhKyam7HTr5DlFDMWLaPybq0enJ1tN 51MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832246; x=1713437046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+zSTvPGfcRjEBEVqiYMcCOTilCqnhe5Ojdjg6D66FBk=; b=tLuuupQfKcDVXPj8y148us6exhJTVjM6Z247toRkD8YRctsg/NykilankRHzeKXnm5 F8Ci8YXQLcLGg4ITbSja/ckXzsrHEj34A+4nJ3fhp2z8WklqDxMQH2gkPayv2T7GJLXi AOkMJREWDaDJjMQfCr1txAsl0KBdOXW6w+dn0K1tMBplXH7yJ5cXjls9yizueurTSjWO AzAVNPHrqw29oLbl02naRA28hiCREJ+Ugj7XJX9Ozeu4usX/ugRwfdGh7S0RA9c5iiPV jDAh69gzfI9xkozTeiNKBuk21b9Ykr+OUyq3Xp+CEL1T4DLIgY7tQWHXCkhqZU9VwYSE eBcw== X-Gm-Message-State: AOJu0YyGn1+Ct4x/o560830v1/5SjX2zFFUnjqL9EPO6nh8oYyqTkMvH Y3LMwrxkCsljGRscswuizGzNQwW8glFJitBjM1J9//cvYSgPJcbfEauE8ldVaVrShUIVt6LDAXm W2P8= X-Received: by 2002:a05:600c:3154:b0:416:b7c0:23bc with SMTP id h20-20020a05600c315400b00416b7c023bcmr4403843wmo.10.1712832246485; Thu, 11 Apr 2024 03:44:06 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id t13-20020a05600c450d00b004171f151a5csm1914852wmo.16.2024.04.11.03.44.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Laurent Vivier Subject: [PATCH 4/9] linux-user/flatload: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:35 +0200 Message-ID: <20240411104340.6617-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- linux-user/flatload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 5b62aa0a2b..b0f04af4b6 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -692,7 +692,7 @@ static int load_flat_shared_library(int id, struct lib_info *libs) char buf[16]; /* Create the file name */ - sprintf(buf, "/lib/lib%d.so", id); + snprintf(buf, sizeofbuf), "/lib/lib%d.so", id); /* Open the file up */ bprm.filename = buf; From patchwork Thu Apr 11 10:43:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787955 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157677wrm; Thu, 11 Apr 2024 03:46:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVl0gH4L4vvz8jUiKGTmBmohX2w73pp4C04Vi6kFVdf0bo/Yux+aun6OyCXAFbq0aVmjFrd5vDJkx7uMxQCU+ED X-Google-Smtp-Source: AGHT+IEfpYFSk5HVgzCOz959ZyuVsZs4pzM5rBbbf9flatr87ekuBZm3quMZ1kul3kZ+PEdCZg7Q X-Received: by 2002:a05:6870:c111:b0:21f:d2a2:7ff4 with SMTP id f17-20020a056870c11100b0021fd2a27ff4mr6236682oad.17.1712832366877; Thu, 11 Apr 2024 03:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832366; cv=none; d=google.com; s=arc-20160816; b=KAHMNCI3NF0wlSTwjIMikLz8b4mZI9ND+2DeChFsBlgXZY+7tO63lL4O6/4m7cFe2V lLS8Ud5renDYHQvmZattI0CAeWu+ZJ+ejgylNuZhV8EJU7U27kt7IFtaLp/8UrtOKQQ+ AEkI1g6zzrGrPBH8asoDVkqBR6Z4DXvQsEQ1U+xZhwgcsxpQRBGiu2HowR6963HE+Yb0 pMwLDvaE916gn6K+Q/qzlvQgzZjYnCNa5tVP0CoxU7pKgZM4HYs4GjzDnsm55w5XHiEL CCRGL3jvIFrlM/7J/Bm93TIdq0efevwOEwxTmeD5sPCM3maG7tnE7qbeey2MqUmlOixl nKAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CeYnoI7aOgEwL66760hzse5mJ3cb0VBg+S1wKs8bFQ0=; fh=zBgAMROPo0xqnDicIPm9Scywe+oxF2lNF81H77wFbG4=; b=Cj+GYZYGaVyYAkmfk9W1Fn2nUMbp85KiwUIDQ6eFMQUy4GV4jyG9sgPNk5C7Fo8paa +A7VW/BYGYnS4jb+/VsCOnpIQuYia1G51YB2NF/YJPQb8aBkc1aoohn01fcxD2BEpqMM KIYVNQMjIWH6g72PJ2e/CAr+9g9oE8ntA/IJPt9v/fzqNtiqIEjyfZZtsdWcYN7dUZjW 8cGUtCcjnc6cYh033KrlykS3fkmqW1OIGjGIxvNKod0YI+IILihZYk3Cbyda+XYOJ6hl hl8yjKwRe6FAxbU5O1qDegMr26CwI0t6axP1HW2jW5+IOyHNQZFuSBqkoB7ukkCoVcwe IPcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G5bDdycK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 2-20020a05620a040200b0078d5e64dd6csi1283060qkp.484.2024.04.11.03.46.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:46:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G5bDdycK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurul-0002xr-5a; Thu, 11 Apr 2024 06:44:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruj-0002x8-2t for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:17 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurug-0004KI-Px for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:16 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-417da6ca440so3572735e9.1 for ; Thu, 11 Apr 2024 03:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832252; x=1713437052; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CeYnoI7aOgEwL66760hzse5mJ3cb0VBg+S1wKs8bFQ0=; b=G5bDdycK8Ly0Pi6hc566NKP7L8l/jED7DIFXFYByOqqqLEwgrjdSHO9AHgGU+hNZ9m xxmdD1IFlkQ5QONWaVPFvCZGvUmflW7gganTiPa0i4o5hb1/MMIbEacA6jAkgbDWF2wi rTwcY5U9RmMLwRerS3J1x2LkEFSndt4OJGfWkfIxaDU1BniN9q6mgykaFMzopGeIFmrD rVa5mu7sguckJ/Q2EdG24xv2Zva4OFBGRY6qVE7GNEBY6XN8U87KQkn8bXj3zSmElcEx KuCUplLGv65ttCDk+sVpt/pJn58g5dyY1Vi14Vz0XsYQI3Nv0UqHXfmyU5MHNQ6OvAHu 1ssA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832252; x=1713437052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CeYnoI7aOgEwL66760hzse5mJ3cb0VBg+S1wKs8bFQ0=; b=TV1y6RfPIrzKuNIz7gKdQ8sFo16wII6dzYvWPAQaa49F5pC44PpUTp1LJuWeRJotiC UhgrrRlvlr2MoXx22WWuZXJ2XZNfyXlQw6JPnhKHcdQX/ctHO9XgPymwgLGOYcB85inu G3nEzGQBN13qyONRXqbfyvG4e9JfCS0RnDcJQdq9yiYyMghpqte2H/vnv5K3SITluhq2 Ti6PkQPV8lUU1o1R6CQ5a90ryqwv/egFXfOGT8n+XcfXqY3a/3hVU7ss6jqPYrTMIQvt sMac+nz4RcqZdVQWQQZ/vLylbfk+FsTGqIMlF/IsLhtjA1GGjwG8S/SBf/q7cBMhT/Mh kZtw== X-Gm-Message-State: AOJu0YwuGKZ8TSbRsZaMVpz9KM7rSv+MWWfu4cNVe1p6xNkZqkueOREu ziroZSFoQiYSfVsZOj69DbzMt1UfaZmxDkk70Q2RQuY6ATgjJ5Ca1VLGLbT0rWXeqPTUhd1j58O ap1s= X-Received: by 2002:adf:ce86:0:b0:346:bc1b:4e7c with SMTP id r6-20020adfce86000000b00346bc1b4e7cmr1325606wrn.35.1712832252684; Thu, 11 Apr 2024 03:44:12 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id c10-20020adfc04a000000b003467a420243sm1485130wrf.12.2024.04.11.03.44.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Peter Maydell , Jean-Christophe Dubois , Andrey Smirnov , Jason Wang , Alistair Francis Subject: [PATCH 5/9] hw/misc/imx: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:36 +0200 Message-ID: <20240411104340.6617-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/misc/imx25_ccm.c | 2 +- hw/misc/imx31_ccm.c | 2 +- hw/misc/imx6_ccm.c | 4 ++-- hw/misc/imx6_src.c | 2 +- hw/misc/imx6ul_ccm.c | 4 ++-- hw/misc/imx7_src.c | 2 +- hw/net/imx_fec.c | 2 +- hw/ssi/imx_spi.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/misc/imx25_ccm.c b/hw/misc/imx25_ccm.c index d888966014..faa726a86a 100644 --- a/hw/misc/imx25_ccm.c +++ b/hw/misc/imx25_ccm.c @@ -91,7 +91,7 @@ static const char *imx25_ccm_reg_name(uint32_t reg) case IMX25_CCM_LPIMR1_REG: return "lpimr1"; default: - sprintf(unknown, "[%u ?]", reg); + snprintf(unknown, sizeof(unknown), "[%u ?]", reg); return unknown; } } diff --git a/hw/misc/imx31_ccm.c b/hw/misc/imx31_ccm.c index a9059bb1f7..125d4fceeb 100644 --- a/hw/misc/imx31_ccm.c +++ b/hw/misc/imx31_ccm.c @@ -89,7 +89,7 @@ static const char *imx31_ccm_reg_name(uint32_t reg) case IMX31_CCM_PDR2_REG: return "PDR2"; default: - sprintf(unknown, "[%u ?]", reg); + snprintf(unknown, sizeof(unknown), "[%u ?]", reg); return unknown; } } diff --git a/hw/misc/imx6_ccm.c b/hw/misc/imx6_ccm.c index 56489d8b57..b1def7f05b 100644 --- a/hw/misc/imx6_ccm.c +++ b/hw/misc/imx6_ccm.c @@ -85,7 +85,7 @@ static const char *imx6_ccm_reg_name(uint32_t reg) case CCM_CMEOR: return "CMEOR"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } @@ -224,7 +224,7 @@ static const char *imx6_analog_reg_name(uint32_t reg) case USB_ANALOG_DIGPROG: return "USB_ANALOG_DIGPROG"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c index 0c6003559f..3766bdf561 100644 --- a/hw/misc/imx6_src.c +++ b/hw/misc/imx6_src.c @@ -68,7 +68,7 @@ static const char *imx6_src_reg_name(uint32_t reg) case SRC_GPR10: return "SRC_GPR10"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx6ul_ccm.c b/hw/misc/imx6ul_ccm.c index bbc0be9921..0ac49ea34b 100644 --- a/hw/misc/imx6ul_ccm.c +++ b/hw/misc/imx6ul_ccm.c @@ -143,7 +143,7 @@ static const char *imx6ul_ccm_reg_name(uint32_t reg) case CCM_CMEOR: return "CMEOR"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } @@ -274,7 +274,7 @@ static const char *imx6ul_analog_reg_name(uint32_t reg) case USB_ANALOG_DIGPROG: return "USB_ANALOG_DIGPROG"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx7_src.c b/hw/misc/imx7_src.c index b3725ff6e7..d19f0450d4 100644 --- a/hw/misc/imx7_src.c +++ b/hw/misc/imx7_src.c @@ -75,7 +75,7 @@ static const char *imx7_src_reg_name(uint32_t reg) case SRC_GPR10: return "SRC_GPR10"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index cee84af7ba..8c91d20d44 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -41,7 +41,7 @@ static const char *imx_default_reg_name(IMXFECState *s, uint32_t index) { static char tmp[20]; - sprintf(tmp, "index %d", index); + snprintf(tmp, sizeof(tmp), "index %d", index); return tmp; } diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index d8a7583ff3..12d897d306 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -53,7 +53,7 @@ static const char *imx_spi_reg_name(uint32_t reg) case ECSPI_MSGDATA: return "ECSPI_MSGDATA"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } From patchwork Thu Apr 11 10:43:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787962 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp158039wrm; Thu, 11 Apr 2024 03:47:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQ8ws//6yJ5JFaL2SWaLkhlVN2ZQPeN9YtCRguy+dBrVKJNkCBTVSKKcZVCFGnitI+5/NKOmDdhFpR03s2elvG X-Google-Smtp-Source: AGHT+IHlzxJXX4UKhBXMOAAenaZOy6Vr6k58DiS79WewRVz4ChLwgVpYDNQd8P8r2ksIOhv9Xmk5 X-Received: by 2002:a05:620a:94c:b0:78d:4a14:b307 with SMTP id w12-20020a05620a094c00b0078d4a14b307mr5600838qkw.44.1712832432789; Thu, 11 Apr 2024 03:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832432; cv=none; d=google.com; s=arc-20160816; b=sCzSrCnjnixjXZagaLdJbRQxAUN09nZCWzDvL/Q6OpoKgJm9ukL4dZjQxmkLM9AQBI 3gDmQhZWb9SH2Yf0MpjU5VFj/evITB73bPfqGgYhtcmfQf4+4oSSlhGYN9qBTi9Fua9r xChH7RffU+CHvpoOLK0vBUi7f+01GGRBT53GJXMYqdSm5L6y8PzCy+2UQVAD6fIrvPdX ZLzbDcoQk52/eDRkVbAeKjEjiJgGU9lJKuEuLoOblSmqlefnJN1oSDzwhbm9sTBveovC 7zstKaYrL5+iIqo3M8waLN+VPbiIGDszFDB9gD1pNbN9o5Dw3EzegMxITxjho+s+PFTQ oOGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=chFRh2l0gcnmg03fCHQ7SXYogZ+gzE1I40m0bX1o6CE=; fh=Slfxqi71ANSv57wMlZx1Qriv6VrM0by9S3CAcx97i5A=; b=stXhkR/2y/Y+DasWh68NHxJwjJBLYTNI6cZ1UEAX/Pp+EMhnMHqJiF0zYikHmeQtoY XufPL8DR9A4LfQHzwLV/mm6eb0zsDn9rF7JK7+7cTjkbHe7Kr0ErIvIi81zDSErvpA/A y2RboBDKKbIuXgPtbdMF96Qeue/iUw4SJHJOkz7HAQHcdR+tdbQwNrbb5ZqQEgIXcXnL 9ez8lzGItJ/oDsHT6xZMna5vRen4kHxoRbQQr4g37kH1tVT2Kf2SGyZovrjwGf7LFwOW vcZgCxHk6Gxr7uXKII3k4gM5w1TiCcYB2N/Hw/WsBYLD/CoizDra1n2C6iJCfjeZU6my 3CUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c5j3mEqI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id xy7-20020a05620a5dc700b0078d5d6af5bbsi1249011qkn.650.2024.04.11.03.47.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c5j3mEqI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurur-0003B3-JZ; Thu, 11 Apr 2024 06:44:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruq-00039P-5G for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:24 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurum-0004Mv-9z for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:23 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4167fce0a41so4154555e9.0 for ; Thu, 11 Apr 2024 03:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832259; x=1713437059; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=chFRh2l0gcnmg03fCHQ7SXYogZ+gzE1I40m0bX1o6CE=; b=c5j3mEqIll58L5zq6hJWJGZLhH1d7hh/36VU6fYKyFvE7mJflDy8Z6/IxZVkoclLC6 Us8uwAhhcOIjWRB5wKRchzmwBY9E8yf6W7fULJ3Be0ehRRyuTjBJs7WSjbMAS975K7I1 PnAl+pFAkjmudj99nUZ3jEWvNGzGwp9ZFJi3xAI1T/6HJIcJkRuntvyUWhmoIvfjTisP akSmFEtZuSWCMwto/n3+ztSYikX0U5COHsw7i6pKKvHG7ObedGuMRSDVuA/150ek0E8q 4YLe8V0pNGJw0WHllYGIl96QB5dm81ulpqa5jVyiGSJeSyrl4gIdQ6bbft69/BKMkLCJ wjdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832259; x=1713437059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=chFRh2l0gcnmg03fCHQ7SXYogZ+gzE1I40m0bX1o6CE=; b=xBwPBnCS8oSlEw6+Go7n6x+vOtgtGDmw2RPeOSYx0NwuJkike8DVwlMi+mqN6MLpTB sB0cXvN72kI5VwcnmGeOVlNjKIsWgT5221c/TT2YJzjevnwXFqes7lfY2UpXN1eCD1xH rl3FBfOy4NgSrIKioMvpPW2+GK6pbdT3TQvpoKsHqqkG+uK5BcaHTzHE5lp+0jzXKwIN 93di0f0spfNRc7MzUhvA4H8RmHrcDtweDze6QQQc/0jUzv8cPzgL7ClwUq3o+32m5T22 66grUyMG6w3km1OallKyM/DjV3jhUSSF5vZxalvSOcNhbCnlUKoAYXotlq54OE8uVGJW fVpA== X-Gm-Message-State: AOJu0YyVM7mzIByMp1duwxkLgcjkqgFI5kNcS+SosBt1QFwP5hVT88Bi rchMeJzYn5EX+SOhYRxNsRg8Y9BwDkuJ6TsqtgHuA3vM+ZI04LRB2N9exXJCvJ4ZpaK9UTAL2b0 7QFY= X-Received: by 2002:a05:600c:4f53:b0:416:89bc:dec6 with SMTP id m19-20020a05600c4f5300b0041689bcdec6mr2004919wmq.11.1712832258773; Thu, 11 Apr 2024 03:44:18 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id he8-20020a05600c540800b00416a08788a5sm5123079wmb.27.2024.04.11.03.44.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Jiri Pirko , Jason Wang Subject: [PATCH 6/9] hw/net/rocker: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:37 +0200 Message-ID: <20240411104340.6617-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/rocker/rocker.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 7ea8eb6ba5..03ac7a7ae9 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -915,40 +915,40 @@ static const char *rocker_reg_name(void *opaque, hwaddr addr) switch (index) { case 0: - sprintf(ring_name, "cmd"); + snprintf(ring_name, sizeof(ring_name), "cmd"); break; case 1: - sprintf(ring_name, "event"); + snprintf(ring_name, sizeof(ring_name), "event"); break; default: - sprintf(ring_name, "%s-%d", index % 2 ? "rx" : "tx", - (index - 2) / 2); + snprintf(ring_name, sizeof(ring_name), "%s-%d", + index % 2 ? "rx" : "tx", (index - 2) / 2); } switch (offset) { case ROCKER_DMA_DESC_ADDR_OFFSET: - sprintf(buf, "Ring[%s] ADDR", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] ADDR", ring_name); return buf; case ROCKER_DMA_DESC_ADDR_OFFSET+4: - sprintf(buf, "Ring[%s] ADDR+4", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] ADDR+4", ring_name); return buf; case ROCKER_DMA_DESC_SIZE_OFFSET: - sprintf(buf, "Ring[%s] SIZE", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] SIZE", ring_name); return buf; case ROCKER_DMA_DESC_HEAD_OFFSET: - sprintf(buf, "Ring[%s] HEAD", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] HEAD", ring_name); return buf; case ROCKER_DMA_DESC_TAIL_OFFSET: - sprintf(buf, "Ring[%s] TAIL", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] TAIL", ring_name); return buf; case ROCKER_DMA_DESC_CTRL_OFFSET: - sprintf(buf, "Ring[%s] CTRL", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] CTRL", ring_name); return buf; case ROCKER_DMA_DESC_CREDITS_OFFSET: - sprintf(buf, "Ring[%s] CREDITS", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] CREDITS", ring_name); return buf; default: - sprintf(buf, "Ring[%s] ???", ring_name); + snprintf(buf, sizeofbuf), "Ring[%s] ???", ring_name); return buf; } } else { From patchwork Thu Apr 11 10:43:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787952 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157240wrm; Thu, 11 Apr 2024 03:44:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWdrXGX4bokvP2i4dsqYKQp/16b5/QUIjU+7FSmHkKZhbf8PwgFq+Wmq5xrdJaJwGkX8AEXoOMTIyHK2IIAcuVW X-Google-Smtp-Source: AGHT+IECy6NrtmB0UISx/Wu+xiKkMWly4Xzq2lWTHgN6cVZUC+E6kdg8Pj4DA+5Wdxyfi4bgi8cn X-Received: by 2002:ad4:5bc7:0:b0:69b:29b2:9ae9 with SMTP id t7-20020ad45bc7000000b0069b29b29ae9mr4381908qvt.64.1712832294646; Thu, 11 Apr 2024 03:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832294; cv=none; d=google.com; s=arc-20160816; b=DAyCfuz7DegoqFk0aqW5WUD9MqpJgKiDZmtSeUFqVnx7XDLEzA6hfwJQMeGJEENSBP 2TBc6gqtVl1BWC5dIbcjMXhT5samKSZWj43TyjczJATK4qnQjoXd33JZxaAoKIhFkitf mwvNEgHFl4BIZ2duCV9KKpWRO6WRQUNhf2V5Y1uj8ZzKw/bSJtkgFX8oAKiKRnhsxwKu Cqba4YY2+3Zr4GS+L2NBWnNA2Hjr4lYtszTrP8kUWR3sJ1josy67S5CigSAs7OPbw4IE yOGI/jcmcqJFJdcSKMotWHAQb2GJ5mb+Vy6rs9TQCpgksASAdgPI9dV5D8+0xEowFX+j dSLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xiqqVJM+uSsQysg2/XmJ/Md8TLOTVsfYAw0sKCriLiE=; fh=6+Pw3xH97gGFzXYf3RZiDG0pTwma7nr3SVorOjtmMzQ=; b=fjUb4HB+HofABJQToukFigvb7DnMiiVkZDl9p5vHcmR4Ebm3eVj0xy+K1yK/iO1Nas kC90l+qLFph9hQMAFIk04LGeHtZlfhao7xLxCk7d0bOAYJhO8HGqAemaAKkpduxYJkkO 8+uCumuFduewZQ46CjUlNKK2mY9S378XxuEHPLTlO+SWIGi6NGLGTWVNAq8CybZfycfa RRSzV0qnjifPM8mrdrmQwOFt3mfx2kypxgxrO2u93XO8fdLvPXPvwtL4JV8T3EVPo/hA SXVk81aLQumB74s/qEbOx4r9spuUh/s7/XHCrS+NP9tnnvSNarwhXKBreYYbraVVZuRB 168Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GZeFCtW9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m12-20020ad44d4c000000b0069b4d64ab0asi679345qvm.339.2024.04.11.03.44.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GZeFCtW9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruruy-0003OX-Bq; Thu, 11 Apr 2024 06:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruruu-0003N8-VN for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:29 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurus-0004Nr-GL for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:28 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-344047ac7e4so433281f8f.0 for ; Thu, 11 Apr 2024 03:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832265; x=1713437065; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xiqqVJM+uSsQysg2/XmJ/Md8TLOTVsfYAw0sKCriLiE=; b=GZeFCtW9AOmnpwAxKfWv9ISvHo97cnyH/2SgCnGbG8O41ShKUf87tOeZFwkDYtNGwF a6/z6Pp8NPeWLcsXQm1nmM3Onw58KbDYigvUXot1c8FDcroYsGvgEWBpK8IM4Cc7lFAG iRvGJIjBdjA5zm0WnTHqUawBCvZCh+vLhC5dsO974tlMfnYXOBWlB6fVN9yjsbV0Qgvt m47JjFs6OYT1ic7MO+RiQa2EQvt1xwb9X419iK9mwSGJNW53SJT3PuCaIzqkYQf2PjNL Hz5aQQPQZh8BACQwP+bXUpYitcYFZ3sbWWBoFm+To7w9/La2P9o7fAEih4fqh+XDnYun FIGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832265; x=1713437065; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xiqqVJM+uSsQysg2/XmJ/Md8TLOTVsfYAw0sKCriLiE=; b=gfuVJiTTFDVQfxAxW36sYu9LmMGo4gVR6elN/Zl/AIVkgdeU5SapiZxeNtKMGaz+WX hYV0ffJzdyovh0KifFKFdXV2KVcjIyd9W3PiQStZuxKvRoeJUC8wDBg1I890Qs1WV5+V eCgWN33HkEacDgeyKlg0jMCrXbOCTKQoXdppbivdykuGpQ0+k+FhVrlsJPeYEcumXaMW Q3CngzdaFNlXzqREUAVoR/TeyddyCgbk+0KF0jYhb+PgUV4t/dzsP/rfNKwtg414efrV 0limXl9NKgp8QLRsXYtIolyGxJ/c1u4kf2R6vDMTxbIk9rQ54ZvsCSmrsdUzrxcG/IZN rkXA== X-Gm-Message-State: AOJu0YwgwHv0vkr28yELjaVyd/CpW7wxJsN/28NCgRthOMxDnDixMsns bUE8j6MvCmlHBFBMtIb93xFdQvlqeAChQwFotP4X5uCnJzrJdQgrwhobbzRJb5dnUC2DV+Qe9QI EVJw= X-Received: by 2002:a5d:46c4:0:b0:343:44cd:7d1e with SMTP id g4-20020a5d46c4000000b0034344cd7d1emr2084780wrs.17.1712832264913; Thu, 11 Apr 2024 03:44:24 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id m5-20020a5d6245000000b0034334af2957sm1470365wrv.37.2024.04.11.03.44.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PATCH 7/9] hw/riscv/virt: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:38 +0200 Message-ID: <20240411104340.6617-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/riscv/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index d171e74f7b..b3fede1207 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1619,7 +1619,7 @@ static char *virt_get_aia_guests(Object *obj, Error **errp) RISCVVirtState *s = RISCV_VIRT_MACHINE(obj); char val[32]; - sprintf(val, "%d", s->aia_guests); + snprintf(val, sizeof(val), "%d", s->aia_guests); return g_strdup(val); } @@ -1785,7 +1785,8 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) object_class_property_add_str(oc, "aia-guests", virt_get_aia_guests, virt_set_aia_guests); - sprintf(str, "Set number of guest MMIO pages for AIA IMSIC. Valid value " + snprintf(str, sizeof(str), + "Set number of guest MMIO pages for AIA IMSIC. Valid value " "should be between 0 and %d.", VIRT_IRQCHIP_MAX_GUESTS); object_class_property_set_description(oc, "aia-guests", str); object_class_property_add(oc, "acpi", "OnOffAuto", From patchwork Thu Apr 11 10:43:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787958 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157785wrm; Thu, 11 Apr 2024 03:46:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX24Z4l+WnM0P7rEpH+Xexk8e5/26SDliVeVFVSXWG/cRI5bHUMMt7yrQFU3FsyeuZm4KdvAPlABbw1qpH+TIBy X-Google-Smtp-Source: AGHT+IGBqk6z0NxKHkcek9+n0o9zgx+PSpJbPPfuZEFplx0vPEw5kFq+xPuK0Hbgxo28qPrYxHwa X-Received: by 2002:ac8:5f0a:0:b0:434:b349:da7 with SMTP id x10-20020ac85f0a000000b00434b3490da7mr5832239qta.26.1712832385876; Thu, 11 Apr 2024 03:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832385; cv=none; d=google.com; s=arc-20160816; b=EAnhJ4MSAntrVrdc8T1Pav38TsAt83m9WJ3ECCi0rKIxzcw1x1RnWDlkPVc12983Wq DJheZ5Myg9XrGnq9GfE6yatUvQyyASS9nwwQK6T3GjXZtGY5qVwXCxsqP2MacomSeIDD ZIlnUP+zqSqWqEdrZrjfjQz1PbFZ/Yk8MK+FFF6E6WNz2zJ54Y26j9MPtZwEV1g6rWd2 MY8nEMXGX60Tg/6Mt73B5XwNlzixF/uHtOKlqymhKpDSOGSVWeDPN2/iAO8WXLmjCvWe q4cKhn6IqtMSipqKgQqFhh7clND+ovHff7aNmhdWpzo9bP2c4rti+QvNzpIuQ0zY/tYM hMzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wlJcz+pht8e4e9xihxB/4ukY7MeVnKXZI9Z44gsjm/E=; fh=Y26SNCcx7mV3+DQ4GiURg25QCLf4EDTrA1pj2iVRPwA=; b=DUeZJh8AWDNlW/QGr06OZfSH9BCL4QhjIzIAkWz+EKlXdCUt8vm/3ukPytF/N4Arqy csT2Li90R3C3PVQcNBZbbWIBJeFnKQujRAcTAMssgRKG6oOBgURGiOuD0ph9kECvAVBP LTUrsDrOt+el66qDGBBgxkjzUVIO19HBIEYWHX/79KML5VIXLxmyftqBxwrh7zmnJV5N oFZWdrP+M3TRqaas1AoJjYxuV5DbRvyTzpUhtZjJAoRBaI7RVeeijOXf2YGuxtzjNi/r iOmmkJebU0JUhsL7oJzq6pYI2s2MqJdnoiMgP3ScBIQsYPwZVxye8A07DIMMGwRc0djw razA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYvTWsYb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z9-20020a05622a060900b004365107d35fsi1183936qta.673.2024.04.11.03.46.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYvTWsYb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurvE-0003Xc-HY; Thu, 11 Apr 2024 06:44:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rurv6-0003R7-7q for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:41 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurv0-0004QA-6K for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:40 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d895e2c6efso49317871fa.0 for ; Thu, 11 Apr 2024 03:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832272; x=1713437072; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wlJcz+pht8e4e9xihxB/4ukY7MeVnKXZI9Z44gsjm/E=; b=TYvTWsYbdqVdvPZebGVAxY5+2AAcEbHQDcDIUPsgZNzwtvceL0xGflGJd8MB8y+vcy sG3D0vPE7OxTm7bUbZU8pXler/adU/QskwRAs4LoAWxZZw6DPviwCWW5GB8isHj2U0Jx FM8NrrsZoj8XvGihIN9eubgmJ1vcS9XTS/EZS6Pky0yohF9vvjd4JZznVMbWZUXtS7uv lKbqonwK5Ow1J+2Aj6WCiWZD3MK1MECeXNVzamSmT2YWehuRZil5PRRFeiF+QeIqQUXI 6xuDYg6h4G80fahJcAujhVzu9vnBciHwPyfkJfLkGCWYKs1RMtNe+p8/PVremI8NfTL+ SfEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832272; x=1713437072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wlJcz+pht8e4e9xihxB/4ukY7MeVnKXZI9Z44gsjm/E=; b=XDIdWWvcb/bBHpSNcUeN9+mG9Ox4wnVPfTFMrgSybuKaWyD1iyZZWc3VsCdpJUOC/V SH6a6mMlY2GaCbELSrpTBamGST8bDAnRyn74sXCG1csK00leK/Ut1NjqYadiOQMhZcli A39aHQWIR1AyXoBcUVcUfTq2xx7tcU3lt0eNUb7unjzgsh/nnbdl25rAg7Iu0K+lvxcY H0TSYMfy17I1uJs8WytKyTcKieuX+yslzj6g+OGx2fHXf9x9zoFVSLJ4uwk6tgAF2C00 gSsHcxYHyNHVgnxJA04nc+bMQC6F2rZaZs/lgnP7HyFdN33LJlVLRo3WxDn5KkA+FAOY Zv9Q== X-Gm-Message-State: AOJu0YxuuH0DXyNkuaPJn+0S2uSUT7o/cGoNlNrYAzlrHEmXwXPxvySU m8K/AUGO4rtEZ5dlZMO53oOYL2bIKi6JACFo5CtVaWCPFLd8Bntnsqt7FBE5zgx7//Aq1vrgANc XqCo= X-Received: by 2002:a2e:904e:0:b0:2d8:4af7:1235 with SMTP id n14-20020a2e904e000000b002d84af71235mr2797615ljg.44.1712832271697; Thu, 11 Apr 2024 03:44:31 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id o9-20020a5d6709000000b00343956e8852sm1471455wru.42.2024.04.11.03.44.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Peter Maydell Subject: [PATCH 8/9] target/arm: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:39 +0200 Message-ID: <20240411104340.6617-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/cpu64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 985b1efe16..f0f4fe6714 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -433,7 +433,7 @@ void aarch64_add_sve_properties(Object *obj) for (vq = 1; vq <= ARM_MAX_VQ; ++vq) { char name[8]; - sprintf(name, "sve%d", vq * 128); + snprintf(name, sizeof(name), "sve%d", vq * 128); object_property_add(obj, name, "bool", cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sve_vq); } @@ -458,7 +458,7 @@ void aarch64_add_sme_properties(Object *obj) for (vq = 1; vq <= ARM_MAX_VQ; vq <<= 1) { char name[8]; - sprintf(name, "sme%d", vq * 128); + snprintf(name, sizeof(name), "sme%d", vq * 128); object_property_add(obj, name, "bool", cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sme_vq); } From patchwork Thu Apr 11 10:43:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787959 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp157938wrm; Thu, 11 Apr 2024 03:46:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX0GYr1BAMqeH85ZHoZu4BcGWeBZk4w4vDbo4/b9RzimBi4ssGD3aXlNCPrPCW8DWKvFYCwPlBpZVt8c93dCEr+ X-Google-Smtp-Source: AGHT+IEIZXsD3sXC4vJjBWPKIWQkEKabJp2w/VdKznQvioqI5VIml4Wm9uC9vLnsyN9VSQHEAclG X-Received: by 2002:ac8:5dcf:0:b0:434:d447:1e79 with SMTP id e15-20020ac85dcf000000b00434d4471e79mr6368827qtx.24.1712832412862; Thu, 11 Apr 2024 03:46:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712832412; cv=none; d=google.com; s=arc-20160816; b=puQJPd9QRIyaTTdlQUu94UNPvibnJWs5DJpuTPvg+zFRQ82sk0eWk619UdIwEQhXva 6FWc6qyvmMHfNoL9q6fB1WRh3uk+MmDQ+lVvzZNacETJGpPoppDbRTM7ZK96NDiWhnZ5 YDGA6SbzR4MS2qpVKhhUePgNMt1Vl5pHxC1U0VKWUgxqKAD84nPjsQSO83SF+cHXADTc i6rdYm3jlafYMwC9wv96/sxgDXS2XKuEXZZlzb8GPFB8jUfM0rR0ZfivB/kdPxThPZSq N/6nPirVCBG599Zhpf6mwaFfsVQs1mLjn7zEg3wfBCxQsNVg/kerSvxWPcsNJmeVCQ5s 7y/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7EwoYTZWhIpfsU+7LZSduNtPHyEqtMdnhAHnqEMdyEo=; fh=nfhhA+1kKK6RAzB8lGiU1j/8iUzwhWVCGvtW5ifjQSU=; b=TbYjKVfVpJtzqhTYe+uBMJwxvUc+B18PttSTHS4xrmVpboFfUCecJh+rVO1DPfRLi+ RlwE+YcMkyLMpn17aURR/6DqfqjcsUEqT5N7GAy2APyGIvlp2sCAEQvx9kABdgqZbnQv bcsrp407Izh5zTB7cxREhVqqro9KvnwgWNagEycoiwmbm9D541oHqQ91bkRIU0fI1utv TgxAPXNq9n3mOVClQivlJhzvbSFCLLk6xH50hUqgJsRGzUHPKUSpiia1FqcPYJrGqqu4 uK2GzSGosNJpwlNFHyiwNkmI05Bn7GOmGUCc+WStjHQYm/nd38m2Nia1k62Z78sZoYV7 5McA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pjFWku9G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p7-20020a05622a00c700b00432c27b3897si1270742qtw.97.2024.04.11.03.46.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:46:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pjFWku9G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurvC-0003VC-7C; Thu, 11 Apr 2024 06:44:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rurv7-0003RF-Br for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:41 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurv5-0004U0-Ay for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:44:41 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4167fce0a41so4156325e9.0 for ; Thu, 11 Apr 2024 03:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712832277; x=1713437077; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7EwoYTZWhIpfsU+7LZSduNtPHyEqtMdnhAHnqEMdyEo=; b=pjFWku9GGDFunh+xiDJKrJoNwOncYxEhPgPFW/6HAh1FpE4veygPGMaolH95MWsOdY dczW0gxf+aC/ehQ5YloRE2RUJWyh46d/9UpShf6BuxEf7HIqFJ0oGhsGPAf0AgVZV+EP 7A1+y+HE8226hc/bGkex6Secn1oUCs25GtxtHG5r2ByGpoYVkVaKlvHHZZa+/7Gq+hkY Q+1egHchIQuxqETlCUcHYS6sTOzTMDMHCZKvPSZepPJ5By5GzlNpAEgwR4Gzuoboa8EH Wogdb1GFU+NR6pY/oD1Fuo66eJcXz0WU+EExULLUXiVxiHJKtkp59KKA0deTKBv0dx3k 5DUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712832277; x=1713437077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7EwoYTZWhIpfsU+7LZSduNtPHyEqtMdnhAHnqEMdyEo=; b=RFNHk7Nf+K3U2AJb/y8+wpCDsrW8RfdgwVI20JCFTmCBn8E5jILvgToGAlafTjI8pr JRvce8TtqJE93GdDuCVSN2U+FcI7fLtjXkSy1WFmrrQ1r8A8azII1SFxUoVsqMTi3Ot0 NEusEH92clSxBcxk9weqmnxzYRSijNFy3aMzpirJz0daUSF/kxBW7VJ920F3IHCeplwJ 63XmQl2D4s7lIvLbPQHAk4YJz9wTH6dNADntGkZow4ubQkARbwbUHJVOjUqE1mT4wq0s xSByhnnvuICwQxVh5v7m53jTaHjFQXGEm/FtRsjl/nKsEz7rcXqi+dqqLMHGAbLuOHJJ OHfw== X-Gm-Message-State: AOJu0YykVVh9WZmKrf7S+hFvuTCqUPa3YYOn/HsyaK6xtN2AbPQYF9G/ n13OQMwz+0P4V+h6Bm5tH9LDP2/RqY6ehucAkNoGAHRCEi0tt0eAZRqVDL6cpH0KmkxRbYC/EgZ v3tI= X-Received: by 2002:a5d:644e:0:b0:33e:6ef3:b68e with SMTP id d14-20020a5d644e000000b0033e6ef3b68emr1785788wrw.34.1712832277566; Thu, 11 Apr 2024 03:44:37 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id q9-20020a5d61c9000000b00343d840b3f8sm1463776wrv.33.2024.04.11.03.44.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:44:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH 9/9] target/i386: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:43:40 +0200 Message-ID: <20240411104340.6617-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411104340.6617-1-philmd@linaro.org> References: <20240411104340.6617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index e68cbe9293..a46d1426bf 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -5335,7 +5335,8 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) case KVM_EXIT_NOTIFY: ctx_invalid = !!(run->notify.flags & KVM_NOTIFY_CONTEXT_INVALID); state = KVM_STATE(current_accel()); - sprintf(str, "Encounter a notify exit with %svalid context in" + snprintf(str, sizeof(str), + "Encounter a notify exit with %svalid context in" " guest. There can be possible misbehaves in guest." " Please have a look.", ctx_invalid ? "in" : ""); if (ctx_invalid ||