From nobody Sun Dec 24 14:02:10 2023 X-Original-To: dev-commits-src-all@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 4SyjQW0GDkz54ff6; Sun, 24 Dec 2023 14:02:11 +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 4SyjQV4Y8tz4CwK; Sun, 24 Dec 2023 14:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703426530; 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=RppC/158IFlu6Siaa+NMI/lERO2eq3zZ+zB2PaTsz68=; b=kMGt02VzNiaOZHt2hGdHBgp7leewjtXSUtSnAmrLjzVTy4YIuQrBpenwOos7wcQLqISs0s d4Gy3ixYOBKweT4/Zs/gH8bXuXIpbPhvEwuwfqVPdiwhcBE9KmjOCtCIhKR4SIsEwQ53Uz N9OZCAz8DgQh7diObRnby4lanaLjmYRYUfIpcU0puQfKqfpCkp33eMoejNaTcNW+qvxRz5 j1tsFuiyApsZifDPEBjKeePc7hJplqzimw5FeKyI2alDRVjKblaOQB5L/M5garnXobIWx5 3JHs2g8ZHxci7CXRoVkVUB3h5oGHVgfHAxKxFp8/Z64Z1ZlQP49GC03uW1wnyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703426530; a=rsa-sha256; cv=none; b=Tu/7DrNn4damDqXvU/uvFX1yaOzJOKVHTGkSNploxa2O9Jr/B8S1BVr0R9MioAXJoCfYNk mSupP+chpQkeJWuKGQYwM/8IOqEzO0JwkLgLjrzD5fu+B3VNk/hQFjGvCzXRQz/26T1ENX 0sdWgtxG/E+VwxJdXxgK0p1a3PjbzDv05OqUvUZ8OktVlj507eIjqSWaOXHVCs66fOb3Js nWUs6gKzySD+wspKGEOEe4tQQMh7nXdG69ZDc8yXO5ZrenJOa3PHlVAK9tdy7YfoMv++Vy QCJnI7u0R3KjAHk/j/HW+BKNMhampCzz7dcsJdDv9S0KG2YPHDRV6y0y/HHsjA== 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=1703426530; 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=RppC/158IFlu6Siaa+NMI/lERO2eq3zZ+zB2PaTsz68=; b=ls41ZmkwdRfHvwfSJFWFNZlCJSbu1tpbfGJoM96TCVSqPTpwKtUHFfU1G5qyLt23GVLEuL aRTJLcvp9h5h31ZD89r0X+FJ/jgI+O4yTSA3RFU2THwh1V2khdH5HIB4YUO/nChMXdvyUq qY4rjs5Gi6m/jwA4whch/Ady5VyPGQVIJ6lRGVf4e19yp+5Lm+IqLfzCWGKF6G/ocjmCHf jlowZGSjmhcHmdEgggpypBDOUKdHsP79V3CXhtl/eQEwArARhlZGBbn6v22EjJQiv6ETT0 BpYjmtWE/Asd3Lr1mG58wTLTUfXfbGdmUkiWEU3xZfnHKNg/dZs6LhRrwfecBw== 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 4SyjQV3cnXzWYK; Sun, 24 Dec 2023 14:02:10 +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 3BOE2AdF057010; Sun, 24 Dec 2023 14:02:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BOE2A2L057007; Sun, 24 Dec 2023 14:02:10 GMT (envelope-from git) Date: Sun, 24 Dec 2023 14:02:10 GMT Message-Id: <202312241402.3BOE2A2L057007@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: 29b3ac60aeac - stable/14 - Silence snprintf truncation warnings in printf_test examples List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: 29b3ac60aeac2ada3cc1a4c1ad8353cd0f420ae8 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=29b3ac60aeac2ada3cc1a4c1ad8353cd0f420ae8 commit 29b3ac60aeac2ada3cc1a4c1ad8353cd0f420ae8 Author: Dimitry Andric AuthorDate: 2023-12-21 22:39:15 +0000 Commit: Dimitry Andric CommitDate: 2023-12-24 13:59:21 +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