From nobody Tue Jul 16 05:12:46 2024 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 4WNRz24WX5z5R12V; Tue, 16 Jul 2024 05:12:46 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WNRz23znXz4hcS; Tue, 16 Jul 2024 05:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721106766; 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=wNtd19RWvU8J/GiTsAovoUptwPrNcBFrYvYpyRLscd0=; b=lB+IM94zPCj8KQyIR3YNFpEjfMUwJXFdbc2UrPP06mlithoqiNE77VPkVxF2LhsPZL6lI8 sehQ1W0k2QU2jJ7Ykhm0gK4AvXGGK2+YlwDd4ipBU+cC/bJZl9NwLzO0QaQfcCOxlYPuqq MAoYFJ88yRal1qctTuAwqSnhAzgruaCsvIYxWCVPZ9k7PUhsL59zMCNOe6bCg6Df7v43tl ASlJHkP4JQSILaR5qP1oLhT904jV2snm7IDds/UF3piDwC+UlJuWb9IxmBQXUT2GZqAA8H VD3vwual5yrSeMeHMG9ANFz0lQ6xRSz7/61P3pl3/lSrpgL5Aa8eG0C7J7C9Sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721106766; a=rsa-sha256; cv=none; b=USw+vG5KpTg9jAE4789d9SApz2uDxwzLcOD3mNq4n2SgFqrfOKdoDua5+5DXAHkwzKy9rn 5X5Dj+2Zy99gh547FnqdYPAZ39+DBqhkCS5DqnvXEuk4NBzCWlFqWgUREmvp2Ima+9sChP XIP4THhle4GlWJ8ORKOJPTPKnNthdGLUujf0NV4sYGbv7B2J932nx/LZWrKskFUKkg4qYZ NXFIRjxvj97MSmHbeu/vdCXzoM5jx//KZ3o4TJVvz9IM3viv/8Frf9vB41LnoOpstTXPNb QsJkbRp0CliwW1YYC9xUTpNh3c63Ppm6SIcS/Oo35Io4Yb54D3UQqvkLf7Yr/Q== 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=1721106766; 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=wNtd19RWvU8J/GiTsAovoUptwPrNcBFrYvYpyRLscd0=; b=vemSdQrVf8IxVBcnuKWnJUUog5eAmGgS5noF8z6HYF5wieRZE3U24xDZGg8OH5kD/dVb7V 9r+5QEM78/dik3RE+6+u+7wzId1GxK4VgGC8ItRy/ZJIQjmJgNfWttevlL/5q9VeMoI//8 aWx7NStHtU3K6PTRE6TxZWjTwEpmrRCQdow5r38xCDj35ZaesBRwqgXGtOt1PmG+AVOsM9 jxmOkVI6sXISwU9ZLn4BfLwUusMEsEmpK7KR90yN+tnSWzHQ4cQJuUPN/X+G1CzIhLijC4 QiyoeXxrQkJj3v9JBNFg6Q/MzNAaO1D3mpMZ6y8rQgo06refGhHXEMjHeWCxKw== 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 4WNRz23cDHzNQ0; Tue, 16 Jul 2024 05:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46G5CkeS056448; Tue, 16 Jul 2024 05:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46G5CkwD056445; Tue, 16 Jul 2024 05:12:46 GMT (envelope-from git) Date: Tue, 16 Jul 2024 05:12:46 GMT Message-Id: <202407160512.46G5CkwD056445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b8730c11a395 - main - include: ssp: fix the build with earlier C standards 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8730c11a395dacc089311ead1c9e015682a1ccb Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b8730c11a395dacc089311ead1c9e015682a1ccb commit b8730c11a395dacc089311ead1c9e015682a1ccb Author: Kyle Evans AuthorDate: 2024-07-16 05:12:27 +0000 Commit: Kyle Evans CommitDate: 2024-07-16 05:12:27 +0000 include: ssp: fix the build with earlier C standards `inline` isn't always a keyword, so we should be using __ssp_inline as we do everywhere else in the _FORTIFY_SOURCE support. Variable declarations in a loop initializer are also not always supported, so declare any loop vars in advance. Reviewed by: kib (earlier version), markj Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45976 --- include/ssp/socket.h | 3 ++- include/ssp/ssp.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/ssp/socket.h b/include/ssp/socket.h index 6c0051ad72dc..30a8f0adf1ea 100644 --- a/include/ssp/socket.h +++ b/include/ssp/socket.h @@ -101,11 +101,12 @@ __ssp_redirect_raw_impl(ssize_t, recvmmsg, recvmmsg, const struct timespec *__restrict timeout)) { const size_t vecsz = __ssp_bos(hdrvec); + size_t i; if (vecsz != (size_t)-1 && vecsz / sizeof(*hdrvec) < vlen) __chk_fail(); - for (size_t i = 0; i < vlen; i++) { + for (i = 0; i < vlen; i++) { __ssp_check_msghdr(&hdrvec[i].msg_hdr); } diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h index bdc14137d45b..a161df31d3d4 100644 --- a/include/ssp/ssp.h +++ b/include/ssp/ssp.h @@ -89,7 +89,7 @@ __ssp_redirect_raw_impl(rtype, fun, symbol, args) { \ #include -static inline int +__ssp_inline int __ssp_overlap(const void *leftp, const void *rightp, __size_t sz) { __uintptr_t left = (__uintptr_t)leftp; @@ -112,11 +112,12 @@ __ssp_inline void __ssp_check_iovec(const struct iovec *iov, int iovcnt) { const size_t iovsz = __ssp_bos(iov); + int i; if (iovsz != (size_t)-1 && iovsz / sizeof(*iov) < (size_t)iovcnt) __chk_fail(); - for (int i = 0; i < iovcnt; i++) { + for (i = 0; i < iovcnt; i++) { if (__ssp_bos(iov[i].iov_base) < iov[i].iov_len) __chk_fail(); }