From nobody Thu Jul 28 14:04:27 2022 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 4LtspM6Q04z4Xqhb; Thu, 28 Jul 2022 14:04:27 +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 4LtspM5ptHz3yCk; Thu, 28 Jul 2022 14:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659017067; 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=LE5jqBKjkiemu8gfeuw1PwNYB2iITyR5G+OJRzBr5As=; b=dD7nHuWOM5M9V6nelVyP6uEZTB/uRV4mPR2JA/7e45vtwjcxXcfdiKnoyw/MmrVh9fNo9X PAsWRuouAPxmQRhHl9LW1YdY54yQoVpzFXdbCzMF5uaj/OnxSf71Odr5mpq3q+gizU8OPt GDz74vFOfWJXVPvIrTGXbhMYgsyP/91nrW1ptfpk19xEjQjRa2smXriiFlerR7GRiijQVl STionMWBjizsIwmV3nEHjBcGtOt0efCADSVy9+YPaxYCOpnWuYduzHOXv4w7IIDVD5875O gGD5lbDJ4adPidWu76RJS9MH+fS4zkR2RvvoV21bp3oOMfz3f9Dk0zWLAtceVg== 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 4LtspM4m7qzyjW; Thu, 28 Jul 2022 14:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26SE4RoW088910; Thu, 28 Jul 2022 14:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26SE4RMK088909; Thu, 28 Jul 2022 14:04:27 GMT (envelope-from git) Date: Thu, 28 Jul 2022 14:04:27 GMT Message-Id: <202207281404.26SE4RMK088909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ea86fed51909 - main - Style(9): Strengthen statements about not using K&R function definitions 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea86fed51909de51b4a5e31a593d625e07f4b21d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659017067; 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=LE5jqBKjkiemu8gfeuw1PwNYB2iITyR5G+OJRzBr5As=; b=JkerxLBIHewXDcWeDZxyxLGDjtX01N2XKoTiYd2izAqgZXIyJBlos5hQImyUJ86YK80hr+ 3Vz/PZlB0Zx4ITqQ2Vpv/nAwpZSUyDhW7v/qYKhWfrc6XCDgMPjSpCy5uF1SndOmh4/vtN PZDrAcsj7+Bz3InAFRxa3wes4dExv73J+7VvTEGJgTcZs9pGkCvkGYpwZAEkNzOoifq99p cad/oZ1Tp7TPV3YlNiFNxzyJV2NsyD0VQCqOOK28wqgwb8d19uf7c2mjCMpfh4WwZo6lvp dfnKrd4fZGzg42TZmRhnEFbQHqW87hmFmF1KotpWWe2mzOKoG2YVRlnKcpFIxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659017067; a=rsa-sha256; cv=none; b=kQqodpaUVhXLfto2NWHVd1CP48uoW1DV1aLGLcFaXjq65g8p1Vg8VuREzr5FBeXGyQS5j2 oU7MAuWxAmx1w9Dqpqc0NssmoBuP55Y0xQg+q45yWDjUhe7NbkjyxaZb0KKTjyhUcO+9Q2 QS3uaKOLfvzaHQ0pWh5ujcY9R9hikr3bziiVhQBRA69fhnmpW9Zb7n+AwcfA9JJSmT6drG j4zrizj/McLpzoaLc7sJjoP9OB2EvlZbrcpEX/1iXMwbWSUNSZiwtdKqQRK7SJvsZYZ3SG W3WSGtZEQqGa5mkmogYxktq4qVB1wht3vaNI9g9LN54HJlWJV1gezok0vd1zcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea86fed51909de51b4a5e31a593d625e07f4b21d commit ea86fed51909de51b4a5e31a593d625e07f4b21d Author: Warner Losh AuthorDate: 2022-07-28 13:58:32 +0000 Commit: Warner Losh CommitDate: 2022-07-28 14:01:54 +0000 Style(9): Strengthen statements about not using K&R function definitions K&R function definitions will soon be obsolete. Work has been underway to remove all K&R function definitions from the tree for a while now. A future C version will remove this construct from the language. So strengthen existing statements about K&R function definitions and declarations. While here, remove __P macro reference. It's not been in active use for almost two decades apart from legacy contrib code. Sponsored by: Netflix Reviewed by: pauamma, rpokala, hselasky, kp, brooks, markm, emaste Differential Revision: https://reviews.freebsd.org/D35945 --- share/man/man9/style.9 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 2c080158567d..3b2e9d7e9d6f 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1995-2019 The FreeBSD Project +.\" Copyright (c) 1995-2022 The FreeBSD Project .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -25,7 +25,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd February 2, 2022 +.Dd July 28, 2022 .Dt STYLE 9 .Os .Sh NAME @@ -467,10 +467,6 @@ Functions that are used locally in more than one module go into a separate header file, e.g., .Qq Pa extern.h . .Pp -Do not use the -.Dv __P -macro. -.Pp In general code can be considered .Dq "new code" when it makes up about 50% or more of the file(s) involved. @@ -797,7 +793,10 @@ do not roll your own. } .Ed .Pp -When converting K&R style declarations to ANSI style, preserve +Do not use K&R style declarations or definitions, they are obsolete +and are forbidden in C23. +Compilers warn of their use and some treat them as an error by default. +When converting K&R style definitions to ANSI style, preserve any comments about parameters. .Pp Long parameter lists are wrapped with a normal four space indent.