From nobody Sat Dec 14 00:11:56 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 4Y968F0D8Dz5gM9L; Sat, 14 Dec 2024 00:11:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y968D3xpcz3x0K; Sat, 14 Dec 2024 00:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734135116; 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=PkkMDjUBOfkCa7yXyEAYBAcDQXKNGCm/VFNGS5Nq8bw=; b=WoQzEatJwb3QOCzfyoJvaDzaVWOIhsff3iCkNW7/ZNovFU60B4gb7vP55iZbR7AbyMUkWM 2dFvfEXjRfByt58nc4ASvKxTyxn2flhbEvNc98siuj01rUPu6BdPjH9udacc6LqFTTSJKm ucH7jGpEPu1ZZuu6VVZ5ansENX6kmVFd+TcJ+XBm/UbSZuj+KcOmPVuRJpHiZM18Knoe+A YnI/+NDVyVSl+OFlWpvdcmm0cTkVWqYcdDJcjSldBin1LXbKPuP2OF9isp8ZlKXl60Fs1Z ZRTAOrnQJJo3uW1BSmkvPSH2Xe3rKS1Hsfwkx2FzM5hRhcNkKypUDtcu/qG54w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734135116; 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=PkkMDjUBOfkCa7yXyEAYBAcDQXKNGCm/VFNGS5Nq8bw=; b=LG/4VN8DgD0dHFiNVKqQt38YU9tNq8djw6/MqLGgPne73WOjBEEtuEaFb6ibVanKiWol78 VUB8hdJWv4aFtbzQjYNft/BAQdObPKG9WFb6XPOFFvp4OWUlzGaRDYQCSbqE4TxHaURU3B wfa+fPoT4DzajGWVJpnfo38FdjOmi/WUADLMqBrpIfzTaw0ZDont1PNPJOMX8XbsHcDi/Z 3EifKF3qtvohYwl02AamVtyxlNDcpOImoWKrnrAxkiNvzZt4M7Fp0pjBSPo+VHMY6fYAFm Bnlb65azwzyOva17papMv+SV2+NyjkgZIzRHhJqUukD2EV76CcBm75Fx58FEfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734135116; a=rsa-sha256; cv=none; b=jTI9cSDv16k68eLuE1RxLADYbzzYyzQ15RU7S5rNyYms1PR9b0yBvCP5SJTh7/IDeWy8ok ZhY4IC5up/NC6OVQQ6A+oWsEieAWRbJcULuqw/5gZIoVoRWY/nyxnD4+wV+4dOBLUHPx4t GOYdUTtuOCvBXvOn4hF+9/iWuy0y/loAFOuOKg+FMuRiwekl2y9lNzXv/Zpi7QMXMcUKIp 87PAxzad61xj2n47hFUe28m5apMqWb+Wao9OgCkeAV9JW0uMxaHBEFDwzKgDDLq4nVnsJV 0LFbdVw+zYRNMlAm5W0Ap+ZAs1936JeG9KDdTAaMrvrL9R+eB4fvfJ5iALGt5g== 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 4Y968D3XxQz10Hx; Sat, 14 Dec 2024 00:11:56 +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 4BE0BuJt055482; Sat, 14 Dec 2024 00:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BE0BugY055479; Sat, 14 Dec 2024 00:11:56 GMT (envelope-from git) Date: Sat, 14 Dec 2024 00:11:56 GMT Message-Id: <202412140011.4BE0BugY055479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9bc9cf4a2ae7 - stable/14 - style(9): deprecate blank lines without local vars 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9bc9cf4a2ae7209ccb19874234304301ed510e77 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9bc9cf4a2ae7209ccb19874234304301ed510e77 commit 9bc9cf4a2ae7209ccb19874234304301ed510e77 Author: Brooks Davis AuthorDate: 2024-12-04 21:43:02 +0000 Commit: Brooks Davis CommitDate: 2024-12-13 21:37:40 +0000 style(9): deprecate blank lines without local vars Previously (208be1617cda) such lines were made optional and several of us had the impression that they were more completely deprecated. Do that now. Requiring a blank line at the top of a function if there are no local declerations dates to the original style.9 commit (b030a30523649) and was present in the first version of admin/style/style from mckusick@ in 1991. It's certainly consistant to have a blank line after a null-set of variables, but today it's unique to BSD source code and an occational point of friction to new developers. Document the historic practice and encourage removal in the context of other changes, but not sweeping removal commits for their own sake. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D47887 (cherry picked from commit ebfb117e2e04ea71b88e4285cbb1b54d9cc5248c) (cherry picked from commit 028dae5d3e886fe4c171689d9fc733e1bd68be71) --- share/man/man9/style.9 | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index ca96f05f8d55..59f0ff8b5c88 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -818,19 +818,15 @@ vaf(const char *fmt, ...) static void usage(void) { - /* Optional blank line goes here. */ .Ed .Pp -Optionally, insert a blank line at the beginning of functions with no local -variables. +Functions should have local variable declarations first, followed by one +blank line, followed by the first statement. +If no local variables are declared, the first line should be a statement. Older versions of this .Nm -document required the blank line convention, so it is widely used in existing -code. -.Pp -Do not insert a blank line at the beginning of functions with local variables. -Instead, these should have local variable declarations first, followed by one -blank line, followed by the first statement. +document required a blank line before code. +Such lines should be removed when signficant changes are made to the code. .Pp Use .Xr printf 3 ,