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: 787946 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp149185wrm; Thu, 11 Apr 2024 03:18:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV+OBnOYA3hnu35WbSNe5KA5S73oXIYNmpCv/a55nrSw6L7Q+M57Ky7IuZU+QlE2Lk+dcTqzjLstWmCwUptQAOs X-Google-Smtp-Source: AGHT+IGBytPYEXadEVZwQd+ifnBETU7X52VPKH4zEi/kh+WcaSmxLIlqZd9aPzgqeUWQtcycnAWU X-Received: by 2002:a05:6830:1e41:b0:6ea:16e9:6d44 with SMTP id e1-20020a0568301e4100b006ea16e96d44mr5808548otj.18.1712830713352; Thu, 11 Apr 2024 03:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712830713; cv=none; d=google.com; s=arc-20160816; b=z63NjNPJ1Q11kz0mA/KwrWwcPRMuengpldGUsLeB0M1p29VGF0SkyyiHsTEE9iO9B6 LEPoo0Rw0bTLohkh1+Ibc9R6VADMrC3ocGWvdMif5PRwPz2/MTz7QN6uB+XQQKKYO8LZ aI5BeelxLnF3sUVY5JhRB0rtdV08Asznwz1yo1Ad4X9HW+N/+4bjD1NRxKjCwjqdIjbR EinwCQmArHw/XwU+YlVqTHXDHmUxbfrotcdXrmzIwGAt82xKncB9hyR2TYRTXA9Brxtn Cvu/7wXGw5kXOF+288I5J37/IsTNzm2OCtXQsAcSgt33/L3HZN/soKY5M/nxDPLM9TE6 +v2w== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=DYu9NeN6C15PoB5yWPnrDM1Qg3VSjQOVFu4GcSZeT34=; fh=TssSa9PNiRIadGrXNk+2LKrlUrl1dXImLX+rT4ruJa4=; b=XiZWfUr9AvRT9EV8pXXnAghiKVOf0QvqbumiFFJoVdxY4eKFLMt6+f9V9CiagSDm+u nMv1mK7BIOd9+sUkwvKQxyejxXfLCBLJpPutGPCj0ZaUOvxYuSgn5hd3AJuoOWwZ2y52 CNMkzqAe00PaSX3pYsSFMGJ2/ktH+h0vxKUAFLU/lqjL6Li0p2rZ9XKCPDhoHMJ3Khe5 tsi2x/p6ZvOyRq/OnEbqpYfurCVDwGnTgsOqpEHC00hHYNRSopDzUUpOp8kotZhfNdYy 6IIR4T4NOjGVrhXVyYiwO3O9Mm1nfgwiTd+E8Z6y5cvGhsR9E1GLdHPTjaabUlxbDc1q rk3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cx3RV9w8; 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 c15-20020a05620a164f00b0078d65a3e820si1229384qko.118.2024.04.11.03.18.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:18:33 -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=Cx3RV9w8; 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 1rurTc-000519-Dw; 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-0004x5-Jb for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:16:10 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurTI-0007Rf-4b for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:15:59 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-417d14b3b29so4420105e9.0 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=v1Dhgf0njb0kAGU+1WUA2UAUCarI1kPVdR9/cBoWC/9rhsL7v+A8qgC0TlNHbovT6n 96dL/uc4HL6Bjez6z5bQNSlrLHAJeARgEzjn5Y/D5YP9ruhMIZejzOMjP4t5KnRb8VXo 35xKKtProUcOLuZ3JZrz5ZRfjIrD0JCUUxt/idp7FMBCdVrdRqnKNaSJiRmKMuK4GG0v 7aHTpS6YW/Nk9ELCZQtNYPMWc7NhQq11LMuxMD4UPdAlPjlhxwfiW6yR+i9XJZV7Njpp s8H3pqNoUiAQc4Ib37xEvoyoLukviiErtxG6th/vy3pNb6lWN4yFdL2ufP0XqsZ4AuIV vkIw== X-Gm-Message-State: AOJu0Yxrzyb2P/lGp42C0vEFxIxIzfowJNlzQIHiOIqc5Vt8ea4EQoL0 JKjHv6Rk9G5J+NjPly/0JuNhXMFzhWKdIvW+qgr5WyycwJPxUfbvwlly8FJPBHeTtxt+2ehJzjj rwgQ= 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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 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(-)