Module Name:    src
Committed By:   rillig
Date:           Thu Mar 10 22:45:24 UTC 2022

Modified Files:
        src/share/misc: style

Log Message:
share/misc/style: clarify enum example code

The only purpose of the enum example is to show that enum constants are
written in uppercase.

The previous code could be mistakenly interpreted as requiring each
definition of an enum type to also define a global variable of that
type, and to make the variable name the abbreviated type name.  Even if
the enum type were prefixed with 'typedef', choosing different names for
the tag and the typedef would not be necessary.

To avoid these possible misinterpretations above, remove the variable
name from the declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/share/misc/style

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/misc/style
diff -u src/share/misc/style:1.62 src/share/misc/style:1.63
--- src/share/misc/style:1.62	Sun Mar 28 14:28:56 2021
+++ src/share/misc/style	Thu Mar 10 22:45:23 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: style,v 1.62 2021/03/28 14:28:56 christos Exp $ */
+/* $NetBSD: style,v 1.63 2022/03/10 22:45:23 rillig 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.62 2021/03/28 14:28:56 christos Exp $");
+__RCSID("$NetBSD: style,v 1.63 2022/03/10 22:45:23 rillig Exp $");
 
 /*
  * VERY important single-line comments look like this.
@@ -151,7 +151,7 @@ do {									\
 enum enumtype {
 	ONE,
 	TWO
-} et;
+};
 
 /*
  * Sometimes we want a macro to be conditionally defined for debugging

Reply via email to