From patchwork Thu Apr 11 10:15: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: 1922465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Cx3RV9w8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VFbHs1bxwz1yY8 for ; Thu, 11 Apr 2024 20:18:17 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurTc-00051L-H8; Thu, 11 Apr 2024 06:16:16 -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 1rurTL-0004x3-Hn for qemu-ppc@nongnu.org; Thu, 11 Apr 2024 06:16:10 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurTG-0007RZ-U6 for qemu-ppc@nongnu.org; Thu, 11 Apr 2024 06:15:59 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-417d42dd5a4so3692275e9.1 for ; Thu, 11 Apr 2024 03:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712830553; x=1713435353; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DYu9NeN6C15PoB5yWPnrDM1Qg3VSjQOVFu4GcSZeT34=; b=Cx3RV9w8wW+GAi+XbsX7x/6b4qcdxcuyoOH1t6BI+h7gSUAUerFu/oNjoAuM8NLAtG f6U6YRZWNcaaQzLXoe69uEFIDhrD8NU45NslJXJmEo2/MZV/20ZPvU94Rsu0g7X/35t5 nq4JZ6AsC7nKeTSTj1+L3GDOQEk02p+PlJ2gopVWHSKFQW8BnFNGexlwU8uKXdgzxwxv RPALybwWTfTGlN91JFk4+GnNE+tAU061KZy61nEw8bG/OQ8nRGDXDlf55ELHXchXc+ZK K1cr5890Yi/NEHjRgEBMvDz2zgdLoyV7g2W/DD9j8DDu50XcowWysYyN76A++AeHJxwG 8UBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712830553; x=1713435353; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DYu9NeN6C15PoB5yWPnrDM1Qg3VSjQOVFu4GcSZeT34=; b=Hn8J2My8X6PVEXSgynML/CrK7P6wMk6ovJMuhJoMT+oofe2XipWYVLuhjicVbdgSzU bw8QuKbkd3Z1bhIvh3agqAMf5R6AJxfhiRlEzKQd7JYzORUD3MTCVIJLjWGUTWxXnPkb bMDc2MuYxH1SU2V5ZMUhO7E9nr7kX5ok2rvoDZwG7qv4BHM9ezERV2qRLT0HB5xbcpNy lIt490AFzWgN1qrqRhh9fIiO1Mj3r24fcMhBrk10BDE7spVe9YqDvz0nnFrnZi8fRkkR LFD1hpDqiMYRgkX3BYkyst+4897wJDcleKM/V271PUHbUD5ALHyqzn9CiKDYUjey5ec+ I9eQ== X-Forwarded-Encrypted: i=1; AJvYcCVf50563KwJY3MCyfwiDvqNmL15TTXzeAdZdjNvue4Pdh0TakbIRBedkad7wfeOpX/F0gif09R8tbbVvxYw+q1oQwZG X-Gm-Message-State: AOJu0YyOHZ3R1YqDYYLaWXmuUnvUp9jYPFC5aoRYjQNKgGjPOmLNFhXV VU4TAoaKG5FLR6ki6uUUHQ428pPAozzRgC4uWhhpYojj/2nv4OnUC0xdigYmJT8= X-Google-Smtp-Source: AGHT+IGfgM4NHsDiXCi+A2tAf3CuQHSnVnG3nzYQJQ/yrV2P9p1w41Q0djsjgQVl9Cm8951JPsJ1xQ== X-Received: by 2002:a05:600c:4f95:b0:416:b650:cefe with SMTP id n21-20020a05600c4f9500b00416b650cefemr4789263wmq.14.1712830553135; Thu, 11 Apr 2024 03:15:53 -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-20020a05600c540800b00416a08788a5sm5055032wmb.27.2024.04.11.03.15.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:15:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Philippe =?unknown-8bit?q?Mathieu-Daud=C3=A9?= Subject: [PATCH v2 00/13] misc: Remove sprintf() due to macOS deprecation Date: Thu, 11 Apr 2024 12:15:36 +0200 Message-ID: <20240411101550.99392-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since v1: - Use snprintf() in patches 1-5 Hi, sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Suggestion to avoid the super-noisy warning on macOS forum are [*]: * use -Wno-deprecated-declarations on the whole build * surgically add #pragma clang diagnostic around each use. None of these options seem reasonable, so we are somehow forced to spend time converting each sprintf() call, even if they are safe enough. I'm so tired of seeing them than I started the conversion. This is the first part. Help for the rest is welcomed. Regards, Phil. [*] https://forums.developer.apple.com/forums/thread/714675 Philippe Mathieu-Daudé (13): ui/console-vc: Replace sprintf() by snprintf() hw/vfio/pci: Replace sprintf() by snprintf() hw/ppc/spapr: Replace sprintf() by snprintf() hw/mips/malta: Add re-usable rng_seed_hex_new() method hw/mips/malta: Replace sprintf() by snprintf() system/qtest: Replace sprintf() by g_string_append_printf() util/hexdump: Rename @offset argument in qemu_hexdump_line() util/hexdump: Have qemu_hexdump_line() return heap allocated buffer util/hexdump: Replace sprintf() by g_string_append_printf() hw/scsi/scsi-disk: Use qemu_hexdump_line() to avoid sprintf() hw/ide/atapi: Use qemu_hexdump_line() to avoid sprintf() hw/dma/pl330: Use qemu_hexdump_line() to avoid sprintf() backends/tpm: Use qemu_hexdump_line() to avoid sprintf() include/qemu/cutils.h | 17 ++++++++++++++--- backends/tpm/tpm_util.c | 24 ++++++++---------------- hw/dma/pl330.c | 12 +++--------- hw/ide/atapi.c | 8 ++------ hw/mips/malta.c | 23 ++++++++++++++--------- hw/ppc/spapr.c | 2 +- hw/scsi/scsi-disk.c | 8 ++------ hw/vfio/pci.c | 2 +- hw/virtio/vhost-vdpa.c | 11 ++++++----- system/qtest.c | 8 +++----- ui/console-vc.c | 2 +- util/hexdump.c | 33 ++++++++++++++++++--------------- 12 files changed, 73 insertions(+), 77 deletions(-)