From nobody Sun Dec 24 14:02:40 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SyjR43SdPz54fxT; Sun, 24 Dec 2023 14:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SyjR42xF2z4F9h; Sun, 24 Dec 2023 14:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703426560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7OGHkjLdmfdixVKHVOru9upFiYIfyNFazCAVf3wRLFU=; b=HBaP52f8i4eYzohvaJG5wchN6NOaFxTBBmbZ7foe2vL9mkZJxTu4wQazmpKUl1gdWTd53u 768e35Q6aaE5s9sJpdV4yGb/0X+ZC8F1Qh835f9TVZLo7k5qNsFk1AzkfztmJR65tvD8Z4 ZcjIii5aLAYdh8ZMrOUnFsDrLLSCVJPGzrLP9St66OtqBggiaa6ielfW2BiORNh45SIloa XnYK/NRWHE/e0gISW0tLer+HFA7bNpIe4icBRUlNlEzJJe5oT9tTGse433Kr1+5LKsSbzU pW2znDMvI9XakpU94v+BXEyzEXkkVyJOl+kv9uTub5R3Sg8aElXO9IYvOJFYmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703426560; a=rsa-sha256; cv=none; b=DMMfDde/2Ox25xzDX4VCVMd/FuMEcKGv+3pxydZpkybVzuAYKVPC3TXtPbzjRxjHKIOKrl Z7Fpss2tNVzR7rQv5aSVSuM1TNRedVSJDv7c0PVRvEjlTrDKhRMtXK0uxTsjXbVnXyQYOk tFkNhHQrFgasLaX/0y31EoiHb0MFpLsS/CHLR5nYg3k6Ei2KtnPsmCSLUc5kI++ahP2Pum wWELCe41/SkObZDd103WVDbvPelG27SvoSO9jUSSKUzmcrh2TYTuzIAqqW0AY88XYZfrp+ TLHJdPJBOENouqVAfkGWYw6MfQ9ftUoUFWtiI3lZhUDNPOPVsom5KEvTxqWH1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703426560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7OGHkjLdmfdixVKHVOru9upFiYIfyNFazCAVf3wRLFU=; b=FnfdqFo+QkgJIWBckB7smN4BbLRdyvDaSzZ+BUIeREoidIU6cR3Jyk7Nz8aAkHkNfpjUKP UbRgdcBPnKPM0BjJW94PfC0SQYqneMc38mlnNfxlORezLCbuJhDL1P9Tvf2DH5FJarIhG5 tUF4DRDG62mFowcJJoZweLxHuyY9Ct1od0KejJYWFoFseVhbJzzRXesRIPV5/znxbKoxNy MAp5jJKAcCFHDXplBtuODi33WnWA1rtbtMH0fkgc+k98bu4pNQMnCapZvgaHWoYz+EAaW2 6joTwy6zOrzuxQW6zZTBOwUAiS8WC6o2Y03Ewg9i1wpzY13REAYLr8eHdrNOQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SyjR41lnfzWwg; Sun, 24 Dec 2023 14:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BOE2eMO057370; Sun, 24 Dec 2023 14:02:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BOE2eBm057367; Sun, 24 Dec 2023 14:02:40 GMT (envelope-from git) Date: Sun, 24 Dec 2023 14:02:40 GMT Message-Id: <202312241402.3BOE2eBm057367@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 0907c0ddbaf2 - stable/13 - Silence snprintf truncation warnings in printf_test examples List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0907c0ddbaf22cc6d5d0e6692885f911e3b4e85f Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=0907c0ddbaf22cc6d5d0e6692885f911e3b4e85f commit 0907c0ddbaf22cc6d5d0e6692885f911e3b4e85f Author: Dimitry Andric AuthorDate: 2023-12-21 22:39:15 +0000 Commit: Dimitry Andric CommitDate: 2023-12-24 14:01:19 +0000 Silence snprintf truncation warnings in printf_test examples Building share/examples/tests with clang 18 results in a few warnings like: share/examples/tests/tests/plain/printf_test.c:67:6: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 17 [-Werror,-Wformat-truncation] 67 | if (snprintf(buffer, sizeof(buffer), "0123456789abcdef") != 16) | ^ Since these tests are meant as an example of testing snprintf overflow, suppress the warnings. MFC after: 3 days (cherry picked from commit 69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b) --- share/examples/tests/tests/atf/Makefile | 4 ++++ share/examples/tests/tests/plain/Makefile | 4 ++++ share/examples/tests/tests/tap/Makefile | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/share/examples/tests/tests/atf/Makefile b/share/examples/tests/tests/atf/Makefile index 305d66c51f38..7614767b6e0a 100644 --- a/share/examples/tests/tests/atf/Makefile +++ b/share/examples/tests/tests/atf/Makefile @@ -46,3 +46,7 @@ file1: @echo "File 1" > ${.TARGET} .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +CWARNFLAGS.printf_test.c+= -Wno-format-truncation +.endif diff --git a/share/examples/tests/tests/plain/Makefile b/share/examples/tests/tests/plain/Makefile index 2594968a6f44..462324309f6a 100644 --- a/share/examples/tests/tests/plain/Makefile +++ b/share/examples/tests/tests/plain/Makefile @@ -46,3 +46,7 @@ file1: @echo "File 1" > ${.TARGET} .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +CWARNFLAGS.printf_test.c+= -Wno-format-truncation +.endif diff --git a/share/examples/tests/tests/tap/Makefile b/share/examples/tests/tests/tap/Makefile index 5b829afd5838..86d3f6805045 100644 --- a/share/examples/tests/tests/tap/Makefile +++ b/share/examples/tests/tests/tap/Makefile @@ -46,3 +46,7 @@ file1: @echo "File 1" > ${.TARGET} .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +CWARNFLAGS.printf_test.c+= -Wno-format-truncation +.endif