diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-10-05 12:11:22 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-10-05 12:11:22 +0000 |
commit | 618c102877c5d44b60ebd1be22c2c637aa4604fd (patch) | |
tree | eb5fc02b9ed98372734f3133bc057ee37d74e774 | |
parent | a1ca806217a6dd6475115cfe130a7c8ac3208364 (diff) |
It is perfectly legal in C++ to use the same name for a struct tag
and a typedef. Remove the bits saying otherwise. We shouldn't
suggest using a leading underscore in a name since such names are
reserved for the language.
-rw-r--r-- | share/man/man9/style.9 | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 141b5b3cddf..4a8900cd995 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: style.9,v 1.71 2017/07/10 21:39:38 tedu Exp $ +.\" $OpenBSD: style.9,v 1.72 2018/10/05 12:11:21 millert Exp $ .\" -.Dd $Mdocdate: July 10 2017 $ +.Dd $Mdocdate: October 5 2018 $ .Dt STYLE 9 .Os .Sh NAME @@ -227,16 +227,7 @@ is both possible and beneficial when using an ordinary struct tag. When convention requires a typedef, make its name match the struct tag. Avoid typedefs ending in .Dq Li \&_t , -except as specified in Standard C or by -.Tn POSIX . -Don't use the same name for a struct tag and a typedef, as this makes -the code unusable from C++. -.Bd -literal -offset indent -/* Make the structure name match the typedef. */ -typedef struct _bar { - int level; -} BAR; -.Ed +except as specified in Standard C or by POSIX. .Bd -literal -offset indent /* * All major routines should have a comment briefly describing what |