From owner-svn-src-head@freebsd.org Mon Feb 12 01:29:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A522F09259 for ; Mon, 12 Feb 2018 01:29:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B00A5767E5 for ; Mon, 12 Feb 2018 01:29:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id k131so4886005ith.4 for ; Sun, 11 Feb 2018 17:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=or9RWhlIgYwKlQItjAwo/cq2yRqIj1i3fhnqUM31jNA=; b=RPJaivfVDFx9C55FnrKTUQi2Zqzrz7MMR8qkrTtQhG9oAvgXvOypREx6lkKJbA4xzc dd4uUXaT7duzpRF4O9XPNdbdS5nsxwu+VZ2ZFoLeprabJMOIcOEqTVfDDfmKXno1zM74 DQdbeuZlqAaIim93t0/dpyyurQFr8H25yS2TkrHThwCXjWTBfgsERShLfX4FvUKDeTzz 5HUHQkwsI/9sFswK/xUtg8EZ6w6rcSxb+hZn+OfIw7S7i/U/qkJDRenCNnMb/RoXX07a QnZ3s5CvhQ/AsyCjcAaJGXFo8HJYfWsY9XuDaR78PGqQ7aDQ7FuLC5NVUbtRKK3D0/uL HGnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=or9RWhlIgYwKlQItjAwo/cq2yRqIj1i3fhnqUM31jNA=; b=RT4hvAygfiATimDwYK6THED+DzpATuOQuvP2jE5FD+legc8Iyr7ci5Seg4VFHS7Mzx VT2qWtkPuyfJO4ESofE0gt1L7BPZmvqLH9FS2WO3XalUqWEf54dM3MhwTVynBoDI+Bct gOXsS/BworxiWpUxE/MaKpoVT6gHyw+Oc6SDDHNbIXsjBXnRZvRxjyCD7cVFoYVQZZQa /Sd3QRY2j0M7gng6rnXfR1qRNL2xF7ZcGLY3fL+VBsidBzzkwAngCgnmMGgPkkR1sz+j UzjPKk8DGlAh9Zc3AkRe8bTzcJs/yIQ3HKBOPCANwRqMmGR6B2fDSEVXRqvSLXX/o42f 16ZQ== X-Gm-Message-State: APf1xPB9CsUo9N7XTiu+CGCVv2Cc9LCAVoECp5kKCKgWMAGXg/iQloVa jaWENEapf2utzVEJjYn6XtmF9aClWZZoOpttkBEoxA== X-Google-Smtp-Source: AH8x227yKRKnME/2MCi1XyzYH7NI6KA25kBvkJmCP0QLUwqBWAbe8A2ON3HH+TPBdiN1bwCyYETfYlV9zZtQnxI5CR0= X-Received: by 10.36.250.193 with SMTP id v184mr3279279ith.64.1518398950786; Sun, 11 Feb 2018 17:29:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Sun, 11 Feb 2018 17:29:10 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180212111457.R873@besplex.bde.org> References: <201802111745.w1BHjcWA050692@repo.freebsd.org> <20180212111457.R873@besplex.bde.org> From: Warner Losh Date: Sun, 11 Feb 2018 18:29:10 -0700 X-Google-Sender-Auth: tC8kjCb8k_kNg51CLJBPaDBoqxM Message-ID: Subject: Re: svn commit: r329127 - head/sys/sys To: Bruce Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 01:29:12 -0000 On Sun, Feb 11, 2018 at 5:55 PM, Bruce Evans wrote: > On Sun, 11 Feb 2018, Warner Losh wrote: > > Log: >> Consistent macro indentation is the hobgoblin of small minds >> >> Line up the macro definitions and names here like the machine/stdarg.h >> files that this replaced. This is easier to read and also makes it >> easier to match up with other includes. Also two space indent va_end >> to match the rest of the surrounding if block. >> > > Any chance of using KNF style? > > The 2-column indent for cpp things is easier to read than the KNF 0-column > indent for cpp things, but is inconsistent with the KNF 8-column indent for > C things, and is harder to write and maintain. > > Modified: head/sys/sys/_stdarg.h >> ============================================================ >> ================== >> --- head/sys/sys/_stdarg.h Sun Feb 11 16:35:56 2018 (r329126) >> +++ head/sys/sys/_stdarg.h Sun Feb 11 17:45:38 2018 (r329127) >> @@ -43,13 +43,13 @@ >> #endif >> >> #ifdef __GNUCLIKE_BUILTIN_STDARG >> - #define va_start(ap, last) __builtin_va_start((ap), (last)) >> - #define va_arg(ap, type) __builtin_va_arg((ap), type) >> - #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) >> + #define va_start(ap, last) __builtin_va_start((ap), (last)) >> + #define va_arg(ap, type) __builtin_va_arg((ap), type) >> + #define __va_copy(dest, src) __builtin_va_copy((dest), (src)) >> > > In KNF, '#define' is not indented, and the tab after '#define' puts the > name in column 8. Here, '#define is indented by 2 columns, and the space > after #define used to put the name in column 2+7+1 = 10; now it puts the > name in column 16 which is too far to the right. > > #if __ISO_C_VISIBLE >= 1999 >> - #define va_copy(dest, src) __va_copy(dest, src) >> + #define va_copy(dest, src) __va_copy(dest, src) >> > > Deeper nesting causes further problems. Now the '#define's are indented > by 2+2 columns. The names used to be indented to match, but they are > now indented uniformly to 16 (except for unconverted ones), so their > indentation no longer reflects the nesting. For 5 levels of nesting, > the #define's would be in column 10 and the tab would indent the names > to column 24. > > #endif >> -#define va_end(ap) __builtin_va_end(ap) >> + #define va_end(ap) __builtin_va_end(ap) >> > > This like was actually in KNF style. Right, but it didn't match the rest of the file :) > > #endif >> >> #if defined(lint) && !defined(va_start) >> > > There are many unchanged misformattings before and after the ones modified > in the patch. These are now more inconsistent than before: > before: > - space instead of tab after #define for idempotency ifdef > - space instead of tab after #define for _VA_LIST_DECLARED > after: > - no tabs in the lint section (4 #define's). One of these is long and > would blow out to 92 columns with tabs instead of spaces. After fixing > the indentation of #define, it still takes 83 columns. > > Other style bugs in this file: > - _VA_LIST_DECLARED is declared before va_list is actually declared. This > is illogical, and its bad style is not used for older #define's of this > type > - space after ! in comment on #endif for idempotency ifdef > - garbage newline before EOF. > > This file scores 67% on knfom(1) after this commit, down from 68% before. > Most of the errors detected are for the 2-column indentation of almost > everything. After fixing this, the score is 95%. IIRC, indent(1) never > reformats cpp directives. knfom(1) uses indent(1) so it doesn't notice > bugs in cpp expressions. The score is only 95% because of bugs in > indent(1). indent(1) fixes the cpp indentation and the garbage before EOF, > but adds the following bugs: > - change the tab in tyhe typedef to a space > - indent the comment on the #endif for the idempotency ifdef. what's knfom? Google gives me garbage when I search for that. Warner