From patchwork Wed Apr 10 16:06:01 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: 787512 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp766391wrs; Wed, 10 Apr 2024 09:07:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWyynQvTRHJTlu5koHnp1orUJzOPcNX+2Ujfg5/LIpqrSGwFMSQ8Btb6q3mcl4SEsR808eczEixvhG+FTHxMTUn X-Google-Smtp-Source: AGHT+IGBiA6npDOllXhUeHd34iHM6dHkRT1qd7XkcCdDElrSAJDkuxYgXox91WeJXbcEFc0k474v X-Received: by 2002:a05:6214:1d2c:b0:699:4493:26cc with SMTP id f12-20020a0562141d2c00b00699449326ccmr3733399qvd.65.1712765252154; Wed, 10 Apr 2024 09:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712765252; cv=none; d=google.com; s=arc-20160816; b=tY1q/nTiRz2Ox3X4iTksWkpTK11vcQ/s99vsIS5WHSObWEyoi9L/AjfdkJVbsQSea2 dOdxSLoNppr0xIMufwLOx1aDwF0lIKbSG4A+VcT501mHbevkOHynn22Fp/LnoiFNoGSp LW3KrbaJ/JyEhm2uxQ+7LlBkXmY45mLAFOLK5tZBfUlNVcNp6M/NSd4Qr5Oj1UJOqYdw /0uQteKraDWdq1N9kezwAIddUBvzHJ31/4fbu4zdkEl5zus8fCmJDtyf8otUKRG8lwqV 8MLb6tkTJjfAlOqRCokXs55IMU1XdF41EvMTCsk+0Q2lLudLNG5up6RuZvRl02GVvRT1 iJVA== 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=Qtkg4POGe6isMYcrXvpVF2IG6m9MMiveeMLsCwcT+VQ=; fh=p8yoxHa5ML4mJnXWYGUfW3W4flmLPcqyR+rvhpg+zLE=; b=zu4e+jDa9ljHwBDwP8OwMUuZ1oloMJAOv1qpoVfu4+W3gsIJjrFpDLx5RzvWa4mMn9 IrKLuu5VhZKGNzcWgU1Valr+u2fuMxXpl3Z0JqPIJJlXPrNJc5UHOeGvlXtkXDpzBqbv DTAbL14HXxdUgERvtp6tUrvNGnjkD18HmuRf2sEszGTw5x0r/mZzQuCPVNoWbJLSSQC5 Vc58vvw7HrmgEosjVKLn1KblBU5ybseDumY1sgiNMlv/BgS1/DVWAus17OPjfWb327rC wuIPldX8JmyjKRbs+B74ElG5aoDIb4BZx1vPH3e/52b9nXJIUQop82VtLdv6A6u148ii 2E8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G6Tg/+7v"; 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 a15-20020a0ccdcf000000b0069b1a4b3a7asi7225268qvn.159.2024.04.10.09.07.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2024 09:07:32 -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="G6Tg/+7v"; 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 1ruaTD-0000CQ-VX; Wed, 10 Apr 2024 12:06:45 -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 1ruaT0-00009p-24 for qemu-devel@nongnu.org; Wed, 10 Apr 2024 12:06:33 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruaSv-0002Yj-GT for qemu-devel@nongnu.org; Wed, 10 Apr 2024 12:06:28 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-56e23bbe06bso1765346a12.0 for ; Wed, 10 Apr 2024 09:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712765177; x=1713369977; 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=Qtkg4POGe6isMYcrXvpVF2IG6m9MMiveeMLsCwcT+VQ=; b=G6Tg/+7vqom4SNpdVIX70ttnwcSqmozkV4XRrB62f/sBjYNHlDrAeIM0oE/kR+KBma q2Vln2RLSFBrBYt/g1N/OsR1qBRIYblNhYQpEdWKX0JRQJtDWH0hziAN+CCCMx79vSyG cPjDX3eigUsYmdAxgnMJwvr9/KZiv/78jjfBDZnTf+NODkuJKuPHx3zJz9bsbxSOXw0y LRoVSBldmYdvnvd9kVfszBe2d2uN9Og/JltDYrjC2bbzoEG7KPrq/ZDWaq8nn+IpyFL/ R8VoJIrWOt+ERWf44wIe8zKMD9cRMtSstpoknlkvMc39a1UZqX54KbzErvKUYJETPjdn RNpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712765177; x=1713369977; 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=Qtkg4POGe6isMYcrXvpVF2IG6m9MMiveeMLsCwcT+VQ=; b=iCeidnlZ1nCQiCuolOLjt0DerXu6GNqG/d2BAhlLmWAflJbrQdmfCGc5npTBtc8KTH YlRvqEwybfJIw6yGFLsEIH3LLYpOoYKTw6fiPfqmJPmL+TxKvBfibTK59SMcXOnramJy R5Vkls/joYxNZr4C3MIZd+68uEXRbgKpRj46/usAOwewIglXuseEP/GffHUSuxpjHtU/ uH5Wpv2j86dNMTdZbT4lLwc9rUj+ibmy8jSIPbZOjJ6/syhb2nM4o9urKwaUnTVyOcWD 7eUypQZ7u5/WvIEW3CmCcM2Vgck0iqfM45NOO/gQ8U19Tj+MgVOFlQjxsxX6KPQy2dyl 18Lw== X-Gm-Message-State: AOJu0YyRJ4SaY28SDtxLLZg00gxScesS9+A8LddsnNqlaN2Uxs0zWHyQ Dve+LnB4rw6BsYDFC3Q+3BbWuu+A3LTti7JcsDjTLEtwWtXhxPV4EtGyxPm7fKRRGHVobgz88x/ A X-Received: by 2002:a50:871c:0:b0:56e:3088:49a with SMTP id i28-20020a50871c000000b0056e3088049amr2567624edb.37.1712765177225; Wed, 10 Apr 2024 09:06:17 -0700 (PDT) Received: from m1x-phil.lan (arl95-h02-176-184-34-173.dsl.sta.abo.bbox.fr. [176.184.34.173]) by smtp.gmail.com with ESMTPSA id i2-20020a50fc02000000b0056e22be831dsm6544900edr.42.2024.04.10.09.06.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Apr 2024 09:06:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, Philippe =?unknown-8bit?q?Mathieu-Daud=C3=A9?= Subject: [PATCH 00/12] misc: Remove sprintf() due to macOS deprecation Date: Wed, 10 Apr 2024 18:06:01 +0200 Message-ID: <20240410160614.90627-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::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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 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é (12): ui/console-vc: Replace sprintf() by g_strdup_printf() hw/vfio/pci: Replace sprintf() by g_strdup_printf() hw/ppc/spapr: Replace sprintf() by g_strdup_printf() hw/mips/malta: Replace sprintf() by g_string_append_printf() 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 | 22 +++++++++++++--------- hw/ppc/spapr.c | 4 ++-- hw/scsi/scsi-disk.c | 8 ++------ hw/vfio/pci.c | 7 +++---- hw/virtio/vhost-vdpa.c | 11 ++++++----- system/qtest.c | 8 +++----- ui/console-vc.c | 4 ++-- util/hexdump.c | 33 ++++++++++++++++++--------------- 12 files changed, 76 insertions(+), 82 deletions(-)