From nobody Thu Dec 21 22:46:06 2023 X-Original-To: dev-commits-src-main@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 4Sx5BQ6Nb6z54N23; Thu, 21 Dec 2023 22:46:06 +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 4Sx5BQ5VMkz4Vhc; Thu, 21 Dec 2023 22:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198766; 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=Ihifob0VRReKnimZts7zUG361dWzL1KLb1yksQA1kV0=; b=pSyD/rkYl1n8icv6Kh2uDRmmGzjZejelmF0w7JTwze3rQ7MrbGtMsomJDd61FEJMqpfHx/ v2afIZatquLzsdLbXH1xfr+R0BVri/6ohy/qmPt+MppLOq9J/BRTbC8CEQG3f1Fc0RVUxd EGR1JUap5JSJnB6JgBPCwX9EXmNPywYtXuvg4/1fn3pJGwpd3jP2LVvY92ACLFML1+3oeH x/frUm5hl+9SxbNGNw5KGBYWDnnC4KmF7nKZudP1huRbDQKaUqHqwSZME5Fo8P5k83AnJm cRSg70/QvYi2OePgdseY8QtI085jyD2jsQdIs5dQunsSDzpjf8U/voeP/M1YAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703198766; a=rsa-sha256; cv=none; b=UcZ2wQ81Q6chGDzl5Z1did+R+IcY/EgMICXDoabN9eyXlImyY221j2WK++h4uwCyc/kG1s 9hmn9nlUdPTzmda8UO5sTc7glnHkcUoOwH/U2Vr60wkL6r9+pVKWuHqnRzhOf2tk2A4LN+ 6PDoVLgIG52W62ggAnsKmlXNbmI6mJjcrEj7H6dZaIWAtOjphj8EEb3HltqApUL18T7lmM YRx9x6uXNVGoTwo06/olIMj+DexVwuBOJyJBHKMD+fsQoIfSpsmuwFAuPm2o3qNvTAV9kc 2Fqj/7qZ/K7kfQcuQqwxbwOX6WtMXY4KTU4qmsvXgh/6//cyn0kuE8FAs2+qwg== 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=1703198766; 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=Ihifob0VRReKnimZts7zUG361dWzL1KLb1yksQA1kV0=; b=aC6IHVGkEl4kExR3Uvi2++qqzxnGxa3xB69Y2HMOskJ2QiAVzHNESScKLxQVwqieeBqPHV gYvq7UyW5STgqVHoMvuWesIlOl+6ga3wIt0m430BW/OACuYyCbbS0eQknEQMtTMoekorrR 4P8tigN+4o0V6MINbO9vU0Q4/lqwYkvQcqgx5D05tdIE3Tvk91/bacBGymzCdO12sl+kxS aa0Sv5Qs9HEQ1+4/oyeWNJOIfbc9kZRsbA7PvWg5evNasQXRnSih7Iy5p+Y4zJ6it/uUfI XbHljz2/sS3Xvl/wFCCyDoLfE/qR8lNQ2wktJ6mtVYdfambMY0DhYVZcU8kQnA== 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 4Sx5BQ4ZnDzrm4; Thu, 21 Dec 2023 22:46:06 +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 3BLMk6iA086052; Thu, 21 Dec 2023 22:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLMk61v086049; Thu, 21 Dec 2023 22:46:06 GMT (envelope-from git) Date: Thu, 21 Dec 2023 22:46:06 GMT Message-Id: <202312212246.3BLMk61v086049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 69c8025a4984 - main - Silence snprintf truncation warnings in printf_test examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b commit 69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b Author: Dimitry Andric AuthorDate: 2023-12-21 22:39:15 +0000 Commit: Dimitry Andric CommitDate: 2023-12-21 22:45:52 +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 --- 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