Package: valgrind
Version: 1:3.24.0-2
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 "groff -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?

troff:<stdin>:43: warning: trailing space in the line
troff:<stdin>:48: warning: trailing space in the line

   * 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.12-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 valgrind depends on:
ii  libc6      2.40-7
ii  libc6-dbg  2.40-7

Versions of packages valgrind recommends:
ii  gdb           16.2-2
ii  python3       3.13.2-1
pn  valgrind-dbg  <none>

Versions of packages valgrind suggests:
pn  kcachegrind   <none>
pn  valgrind-mpi  <none>

-- no debconf information
Input file is cg_diff.1

Output from "mandoc -T lint  cg_diff.1": (shortened list)


      1 input text line longer than 80 bytes: diffs two Cachegrind...
      4 skipping paragraph macro: PP after SH

-.-.

Output from "test-groff -mandoc -t -ww -z cg_diff.1": (shortened list)

      2 trailing space in the line

Remove trailing space with: sed -e 's/  *$//'

-.-.

Show if docman-to-man created this.

Who is actually creating this man page?  Debian or upstream?

Is the generating software out of date?

4:.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

38:diffs two Cachegrind output files into a single Cachegrind output file\&. It 
is deprecated because

-.-.

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 34, length 87

\fBcg_diff\fR [\fIoptions\fR] \fIcachegrind\-out\-file1\fR 
\fIcachegrind\-out\-file2\fR

Line 38, length 98

diffs two Cachegrind output files into a single Cachegrind output file\&. It is 
deprecated because


-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

67:cg_annotate(1), valgrind(1),

-.-.


No need for '\&' to be in front of a period (.),
if there is a character in front of it.

Remove with "sed -e 's/\\&\././g'".


10:.TH "CG_DIFF" "1" "01/22/2025" "Release 3\&.24\&.0" "cg_diff"
38:diffs two Cachegrind output files into a single Cachegrind output file\&. It 
is deprecated because
40:can now do much the same thing, but better\&.
45:Show the help message\&.
50:Show the version number\&.
57:search\-and\-replace expression that is applied to all filenames\&.
63:\fB\-\-mod\-filename\fR, but for filenames\&.
68:$INSTALL/share/doc/valgrind/html/index\&.html
70:http://www\&.valgrind\&.org/docs/manual/index\&.html\&;.
73:Nicholas Nethercote\&.

-.-.

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

26:.ad l

-.-.

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

30:.SH "NAME"
32:.SH "SYNOPSIS"
35:.SH "DESCRIPTION"
41:.SH "OPTIONS"
65:.SH "SEE ALSO"
71:.SH "AUTHOR"

-.-.

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

troff:<stdin>:43: warning: trailing space in the line
troff:<stdin>:48: warning: trailing space in the line

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- cg_diff.1   2025-03-04 11:18:24.094321944 +0000
+++ cg_diff.1.new       2025-03-04 11:35:57.596830086 +0000
@@ -7,7 +7,7 @@
 .\"    Source: Release 3.24.0
 .\"  Language: English
 .\"
-.TH "CG_DIFF" "1" "01/22/2025" "Release 3\&.24\&.0" "cg_diff"
+.TH CG_DIFF 1 01/22/2025 "Release 3.24.0" cg_diff
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -23,51 +23,49 @@
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
-.ad l
+.na
 .\" -----------------------------------------------------------------
 .\" * MAIN CONTENT STARTS HERE *
 .\" -----------------------------------------------------------------
-.SH "NAME"
+.SH NAME
 cg_diff \- (deprecated) diffs two Cachegrind output files
-.SH "SYNOPSIS"
+.SH SYNOPSIS
 .HP \w'\fBcg_diff\fR\ 'u
-\fBcg_diff\fR [\fIoptions\fR] \fIcachegrind\-out\-file1\fR 
\fIcachegrind\-out\-file2\fR
-.SH "DESCRIPTION"
-.PP
+\fBcg_diff\fR [\fIoptions\fR] \fIcachegrind\-out\-file1\fR \
+\fIcachegrind\-out\-file2\fR
+.SH DESCRIPTION
 \fBcg_diff\fR
-diffs two Cachegrind output files into a single Cachegrind output file\&. It 
is deprecated because
+diffs two Cachegrind output files into a single Cachegrind output file.
+It is deprecated because
 \fBcg_annotate\fR
-can now do much the same thing, but better\&.
-.SH "OPTIONS"
-.PP
-\fB\-h \-\-help \fR
+can now do much the same thing, but better.
+.SH OPTIONS
+\fB\-h \-\-help\fR
 .RS 4
-Show the help message\&.
+Show the help message.
 .RE
 .PP
-\fB\-\-version \fR
+\fB\-\-version\fR
 .RS 4
-Show the version number\&.
+Show the version number.
 .RE
 .PP
 \fB\-\-mod\-filename=<expr> [default: none]\fR
 .RS 4
 Specifies an
 \fBs/old/new/\fR
-search\-and\-replace expression that is applied to all filenames\&.
+search\-and\-replace expression that is applied to all filenames.
 .RE
 .PP
 \fB\-\-mod\-funcname=<expr> [default: none]\fR
 .RS 4
 Like
-\fB\-\-mod\-filename\fR, but for filenames\&.
+\fB\-\-mod\-filename\fR, but for filenames.
 .RE
-.SH "SEE ALSO"
-.PP
-cg_annotate(1), valgrind(1),
-$INSTALL/share/doc/valgrind/html/index\&.html
+.SH SEE ALSO
+.BR cg_annotate "(1), " valgrind (1),
+$INSTALL/share/doc/valgrind/html/index.html
 or
-http://www\&.valgrind\&.org/docs/manual/index\&.html\&;.
-.SH "AUTHOR"
-.PP
-Nicholas Nethercote\&.
+http://www.valgrind.org/docs/manual/index.html.
+.SH AUTHOR
+Nicholas Nethercote.
  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