Package: libselinux1-dev
Version: 3.8.1-1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man 
page"

  [Use "grep -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?

an.tmac:<stdin>:4: style: .TH missing fourth argument; consider package/project 
name and version (e.g., "groff 1.23.0")


   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.20-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libselinux1-dev depends on:
ii  libpcre2-dev  10.45-1
ii  libselinux1   3.8.1-1
ii  libsepol-dev  3.8.1-1

libselinux1-dev recommends no packages.

libselinux1-dev suggests no packages.

-- no debconf information
Input file is avc_cache_stats.3

Output from "mandoc -T lint  avc_cache_stats.3": (shortened list)

      1 input text line longer than 80 bytes: The userspace AVC ma...
      1 input text line longer than 80 bytes: avc_cache_stats, avc...
      1 input text line longer than 80 bytes: produce log messages...

-.-.

Output from "test-nroff -mandoc -t -ww -z avc_cache_stats.3": (shortened list)

      2         Use macro '.B' for one argument or split argument.
      2 .BI is for at least 2 arguments, got 1

-.-.

Use the correct macro for the font change of a single argument or
split the argument into two.

13:.BI "void avc_av_stats(void);"
15:.BI "void avc_sid_stats(void);"

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.  

Line 6, length 87

avc_cache_stats, avc_av_stats, avc_sid_stats \- obtain userspace SELinux AVC 
statistics

Line 20, length 115

The userspace AVC maintains two internal hash tables, one to store security 
ID's and one to cache access decisions.

Line 25, length 254

produce log messages indicating the status of the access decision and SID 
tables, respectively.  The messages contain the number of entries in the table, 
number of hash buckets and number of buckets used, and maximum number of 
entries in a single bucket.

Longest line is number 25 with 254 characters

-.-.

Put a subordinate sentence (after a comma) on a new line.

avc_cache_stats.3:6:avc_cache_stats, avc_av_stats, avc_sid_stats \- obtain 
userspace SELinux AVC statistics
avc_cache_stats.3:20:The userspace AVC maintains two internal hash tables, one 
to store security ID's and one to cache access decisions.
avc_cache_stats.3:25:produce log messages indicating the status of the access 
decision and SID tables, respectively.  The messages contain the number of 
entries in the table, number of hash buckets and number of buckets used, and 
maximum number of entries in a single bucket.
avc_cache_stats.3:86:are reset to zero.  The SID table, however, is left
avc_cache_stats.3:89:When a policy change notification is received, a call to

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

avc_cache_stats.3:4:.TH "avc_cache_stats" "3" "27 May 2004" "" "SELinux API 
documentation"
avc_cache_stats.3:5:.SH "NAME"
avc_cache_stats.3:8:.SH "SYNOPSIS"
avc_cache_stats.3:17:.BI "void avc_cache_stats(struct avc_cache_stats *" stats 
");"
avc_cache_stats.3:19:.SH "DESCRIPTION"
avc_cache_stats.3:80:.SH "NOTES"
avc_cache_stats.3:93:.SH "AUTHOR"

-.-.

Use ".na" (no adjustment) instead of ".ad l" (and ".ad" to begin the
same adjustment again as before).

97:.ad l

-.-.

Section headings (.SH and .SS) do not need quoting their arguments.

5:.SH "NAME"
8:.SH "SYNOPSIS"
19:.SH "DESCRIPTION"
80:.SH "NOTES"
93:.SH "AUTHOR"
96:.SH "SEE ALSO"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z 
":

an.tmac:<stdin>:4: style: .TH missing fourth argument; consider package/project 
name and version (e.g., "groff 1.23.0")
an.tmac:<stdin>:13: misuse, warning: .BI is for at least 2 arguments, got 1
        Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:15: misuse, warning: .BI is for at least 2 arguments, got 1
        Use macro '.B' for one argument or split argument.

-.-.

Generally:
--- avc_cache_stats.3   2025-04-01 20:37:57.351332916 +0000
+++ avc_cache_stats.3.new       2025-04-01 20:48:55.609519311 +0000
@@ -1,28 +1,35 @@
 .\" Hey Emacs! This file is -*- nroff -*- source.
 .\"
 .\" Author: Eamon Walsh (ewa...@tycho.nsa.gov) 2004
-.TH "avc_cache_stats" "3" "27 May 2004" "" "SELinux API documentation"
-.SH "NAME"
+.TH avc_cache_stats 3 "27 May 2004" "" "SELinux API documentation"
+.SH NAME
 avc_cache_stats, avc_av_stats, avc_sid_stats \- obtain userspace SELinux AVC 
statistics
 .
-.SH "SYNOPSIS"
+.SH SYNOPSIS
 .B #include <selinux/selinux.h>
 .br
 .B #include <selinux/avc.h>
 .sp
-.BI "void avc_av_stats(void);"
+.B void avc_av_stats(void);
 .sp
-.BI "void avc_sid_stats(void);"
+.B void avc_sid_stats(void);
 .sp
-.BI "void avc_cache_stats(struct avc_cache_stats *" stats ");"
+.BI "void avc_cache_stats(struct avc_cache_stats *" stats );
 .
-.SH "DESCRIPTION"
-The userspace AVC maintains two internal hash tables, one to store security 
ID's and one to cache access decisions.
+.SH DESCRIPTION
+The userspace AVC maintains two internal hash tables,
+one to store security ID's
+and one to cache access decisions.
 
 .BR avc_av_stats ()
 and
 .BR avc_sid_stats ()
-produce log messages indicating the status of the access decision and SID 
tables, respectively.  The messages contain the number of entries in the table, 
number of hash buckets and number of buckets used, and maximum number of 
entries in a single bucket.
+produce log messages indicating the status of the access decision
+and SID tables, respectively.
+The messages contain the number of entries in the table,
+number of hash buckets
+and number of buckets used,
+and maximum number of entries in a single bucket.
 
 .BR avc_cache_stats ()
 populates a structure whose fields reflect cache activity:
@@ -77,24 +84,25 @@ Number of cache misses.
 .I cav_probes
 Number of entries examined while searching the cache.
 .
-.SH "NOTES"
+.SH NOTES
 When the cache is flushed as a result of a call to
 .BR avc_reset ()
 or a policy change notification,
 the statistics returned by
 .BR avc_cache_stats ()
-are reset to zero.  The SID table, however, is left
-unchanged.
+are reset to zero.
+The SID table, however, is left unchanged.
 
-When a policy change notification is received, a call to
+When a policy change notification is received,
+a call to
 .BR avc_av_stats ()
 is made before the cache is flushed.
 .
-.SH "AUTHOR"
+.SH AUTHOR
 Eamon Walsh <ewa...@tycho.nsa.gov>
 .
-.SH "SEE ALSO"
-.ad l
+.SH SEE ALSO
+.na
 .nh
 .BR avc_init (3),
 .BR avc_has_perm (3),
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  See man-pages(7), item "semantic newline".

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -d -u <out1> <out2>

and for groff, using

\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output from 'diff -d -u ...' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option \"-warnings=w\"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT=\"-ww -b -z\"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-

Reply via email to