Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/misc Remove confusing advice about macros that might e...



details:   https://anonhg.NetBSD.org/src/rev/c8a30efa7043
branches:  trunk
changeset: 936700:c8a30efa7043
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Aug 02 01:36:46 2020 +0000

description:
Remove confusing advice about macros that might expand to nothing.

Such macros should not exist; as advised earlier in the file, they
should expand to `__nothing' (literally) from <sys/cdefs.h> which
itself expands to ((void)0) precisely so that the problem this advice
sought to avoid does not arise.

diffstat:

 share/misc/style |  17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diffs (38 lines):

diff -r df2753f07bae -r c8a30efa7043 share/misc/style
--- a/share/misc/style  Sun Aug 02 01:35:07 2020 +0000
+++ b/share/misc/style  Sun Aug 02 01:36:46 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: style,v 1.58 2020/08/02 01:35:07 riastradh Exp $ */
+/* $NetBSD: style,v 1.59 2020/08/02 01:36:46 riastradh Exp $ */
 
 /*
  * The revision control tag appears first, with a blank line after it.
@@ -30,7 +30,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: style,v 1.58 2020/08/02 01:35:07 riastradh Exp $");
+__RCSID("$NetBSD: style,v 1.59 2020/08/02 01:36:46 riastradh Exp $");
 
 /*
  * VERY important single-line comments look like this.
@@ -267,19 +267,6 @@
                stmt;
 
        /*
-        * Braces are required for control statements with a single statement
-        * that may expand to nothing.
-        */
-#ifdef DEBUG_FOO
-#define DPRINTF(a) printf a
-#else
-#define DPRINTF(a)
-#endif
-       if (broken) {
-               DPRINTF(("broken is %d\n", broken));
-       }
-
-       /*
         * Parts of a for loop may be left empty.  Don't put declarations
         * inside blocks unless the routine is unusually complicated.
         */



Home | Main Index | Thread Index | Old Index