From nobody Wed Dec 04 21:44:01 2024 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 4Y3WHk0CZ2z5gFP5; Wed, 04 Dec 2024 21:44:02 +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 4Y3WHj6sTYz4NXv; Wed, 4 Dec 2024 21:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733348642; 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=g1cgK6zI5I+UJzpvOUpXXqgwf73Lisz2ntbT+SvOro4=; b=UTEM1GLLPZnUdx46YL/q4DhKwPWKdmcOJNlr3JPZImAIl4HniiMEsVD3gglh7C8m/FFeR0 ei84CKNleZiX24aVaMyBCxzWYk2vD+RszpSSwJKf4fUEVjmktpycnnFcnBw/nTlvQ2HowX s3lm7xZp1dH9HLjM0uTDHWgVRA/Zr+dM2e0LxFfbqFBrSi/NWGzyUZKOuiXLX/QiMUvHF1 JOe5zZD9yDmS+LNJwXRcqEKU5+e4kOuXwwRhwE6wagqeijLbBmiMu9K97OEhzMWhDUGl8n NtjBMcOfV5Gl4NrN2q6QNTCsx6hOIMdWxig1cICDOvAzUGOCGpRaxPGXYMfunw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733348642; 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=g1cgK6zI5I+UJzpvOUpXXqgwf73Lisz2ntbT+SvOro4=; b=Syrv2F2EsqRszTSmQwxgU+lzW7KfMXkQpDQcuiE4ZDn+yFIOYO/JD+6m+9+irLL3C51cmj SAmBQb11vg8/lKk3KhfP/JOj2jNXN1JJYQqmuo4mw9nfOA+pZBPUgHyBvPLddp/Zh/kqeG J69/oGvA8JQkBoaPLoElwZL7lCqrgUie3ZoqniBdEWmZ9D+HLmycEv59vHzKStZ4WAamWk Q84ltNu8zr8Zk9aR3Jt9O3JpaECzhviokKaebY/4NDc+SRx43tH3JqgCwNI2dQPLygqGrC E0Pf1Ak74uQW2l9R/HnlUEbXO158/d7Hsd56bU+C7oIuC6mKe1mRIjHkF00aNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733348642; a=rsa-sha256; cv=none; b=s7OWupb35qqNsSrMSlWAniTD+/k7Q+C7Yd/5wOk+1nLeEGJ6eUzvGcqVuJ9aOuVBPbEbhg Tszm6olkiKo3jID+U7wOg5+nl0CaivBAa91aPgeeKGmON4IAFQbZIAPeL9f+h3l7Cb++uL DE/yJ04h7GNamJsXNTCjf0vROQBXKT9EJFACD7dU9IQn96qBIZrFTSEUNbgd/+n8qOvXfi xAuae1KrxUdoraOE/cP+SIfWX+SyMzOOa8btD1NH4JDbL5xrqThjMY5F/KxiMB0Yw+vSdl yGRaD8I1OwOZD73rLidLDOg8ojxoT0Rl1POMdFtmGZLTXVT+tE5jqE8TDfBc/g== 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 4Y3WHj6Sq8zPmD; Wed, 4 Dec 2024 21:44:01 +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 4B4Li1l6031928; Wed, 4 Dec 2024 21:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B4Li12R031925; Wed, 4 Dec 2024 21:44:01 GMT (envelope-from git) Date: Wed, 4 Dec 2024 21:44:01 GMT Message-Id: <202412042144.4B4Li12R031925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: ebfb117e2e04 - main - style(9): deprecate blank lines without local vars 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ebfb117e2e04ea71b88e4285cbb1b54d9cc5248c Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ebfb117e2e04ea71b88e4285cbb1b54d9cc5248c commit ebfb117e2e04ea71b88e4285cbb1b54d9cc5248c Author: Brooks Davis AuthorDate: 2024-12-04 21:43:02 +0000 Commit: Brooks Davis CommitDate: 2024-12-04 21:43:31 +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 --- share/man/man9/style.9 | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 9bf30370a374..04ee6fcdc0dd 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 2, 2024 +.Dd December 3, 2024 .Dt STYLE 9 .Os .Sh NAME @@ -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 statment. 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 ,