bug#50167: fixes for "fmt - -" etc.

2021-08-25 Thread Jim Meyering
On Wed, Aug 25, 2021, 4:37 PM Bernhard Voelker 
wrote:

> On 8/25/21 10:38 AM, Jim Meyering wrote:
> > * cfg.mk (exclude_file_name_regexp--sc_system_h_headers):
> > Add find-mount-point.h to the regexp.
>
> +1
> even better, thanks.
>

Thanks. Pushed.

>


bug#50167: fixes for "fmt - -" etc.

2021-08-25 Thread Bernhard Voelker
On 8/25/21 10:38 AM, Jim Meyering wrote:
> * cfg.mk (exclude_file_name_regexp--sc_system_h_headers):
> Add find-mount-point.h to the regexp.

+1
even better, thanks.

Have a nice day,
Berny





bug#50167: fixes for "fmt - -" etc.

2021-08-25 Thread Jim Meyering
On Tue, Aug 24, 2021 at 11:10 PM Paul Eggert  wrote:
> On 8/24/21 12:42 PM, Bernhard Voelker wrote:
> > Was there a particular reason to include stdlib.h?
>
> It's needed to declare 'free', which is used by  _GL_ATTRIBUTE_DEALLOC_FREE.
>
> I added "#include " so that find-mount-point.h would be an
> independent header, potentially useful outside coreutils. If that's the
> intent, we should fix "make syntax-check" to not complain about this
> situation. If it's not the intent then your patch looks good.
>
> Jim, what's your opinion on this?

I propose this change:


0001-maint-avoid-new-syntax-check-failure.patch
Description: Binary data


bug#50167: fixes for "fmt - -" etc.

2021-08-24 Thread Paul Eggert

On 8/24/21 12:42 PM, Bernhard Voelker wrote:

Was there a particular reason to include stdlib.h?


It's needed to declare 'free', which is used by  _GL_ATTRIBUTE_DEALLOC_FREE.

I added "#include " so that find-mount-point.h would be an 
independent header, potentially useful outside coreutils. If that's the 
intent, we should fix "make syntax-check" to not complain about this 
situation. If it's not the intent then your patch looks good.


Jim, what's your opinion on this?





bug#50167: fixes for "fmt - -" etc.

2021-08-24 Thread Bernhard Voelker
Hi Paul,

On 8/22/21 10:12 PM, Paul Eggert wrote:
> Subject: [PATCH 4/4] df: pacify -Wsuggest-attribute=malloc
>
> Problem found with latest Gnulib and GCC 11.2.1.
> * src/find-mount-point.h (find_mount_point):
> Add _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.
> ---
>  src/find-mount-point.h | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/find-mount-point.h b/src/find-mount-point.h
> index 028b2500c..a1bbcdc92 100644
> --- a/src/find-mount-point.h
> +++ b/src/find-mount-point.h
> @@ -14,4 +14,7 @@
> You should have received a copy of the GNU General Public License
> along with this program.  If not, see .  */
>
> -extern char *find_mount_point (char const *, struct stat const *);
> +#include 
> +
> +extern char *find_mount_point (char const *, struct stat const *)
> +  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;

`make syntax-check` complains:
  src/find-mount-point.h:17:#include 
  maint.mk: the above are already included via system.h
  make: *** [cfg.mk:174: sc_system_h_headers] Error 1

The attached fixes it.
Was there a particular reason to include stdlib.h?

Have a nice day,
Berny
>From fd277435c8cc4b758c101b9466fd8e86f4f37807 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Tue, 24 Aug 2021 21:32:26 +0200
Subject: [PATCH] maint: avoid sc_system_h_headers error

`make syntax-check` complains:
  src/find-mount-point.h:17:#include 
  maint.mk: the above are already included via system.h
  make: *** [cfg.mk:174: sc_system_h_headers] Error 1

* src/find-mount-point.h (#include ): Remove again.
---
 src/find-mount-point.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/find-mount-point.h b/src/find-mount-point.h
index a1bbcdc92..be0d367be 100644
--- a/src/find-mount-point.h
+++ b/src/find-mount-point.h
@@ -14,7 +14,5 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
-#include 
-
 extern char *find_mount_point (char const *, struct stat const *)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
-- 
2.32.0



bug#50167: fixes for "fmt - -" etc.

2021-08-22 Thread Paul Eggert
After finding a similar problem in GNU grep, I audited coreutils for 
issues involving reading stdin twice, or neglecting to report read 
errors, and installed the attached. The 2nd patch does the real work; 
the rest is merely doc or Gnulib patches.
>From b6a0654e04482f400eb2d5752ec13e15eb53743c Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Sun, 22 Aug 2021 11:24:29 -0700
Subject: [PATCH 1/4] doc: spell out stdin, stdout, stderr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/coreutils.texi: Spell out words like “stdin” in
English prose.
---
 doc/coreutils.texi | 29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 9cc14c008..a435ed63e 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -2291,7 +2291,8 @@ basenc @var{encoding} --decode [@var{option}]@dots{} [@var{file}]
 @end example
 
 The @var{encoding} argument is required. If @var{file} is omitted,
-reads input from stdin. The @option{-w/--wrap},@option{-i/--ignore-garbage},
+@command{basenc} reads from standard input.
+The @option{-w/--wrap},@option{-i/--ignore-garbage},
 @option{-d/--decode} options of this command are precisely the same as
 for @command{base64}. @xref{base64 invocation}.
 
@@ -3356,11 +3357,11 @@ Split @var{input} to @var{chunks} output files where @var{chunks} may be:
 
 @example
 @var{n}  generate @var{n} files based on current size of @var{input}
-@var{k}/@var{n}only output @var{k}th of @var{n} to stdout
+@var{k}/@var{n}output only @var{k}th of @var{n} to standard output
 l/@var{n}generate @var{n} files without splitting lines or records
-l/@var{k}/@var{n}  likewise but only output @var{k}th of @var{n} to stdout
+l/@var{k}/@var{n}  likewise but output only @var{k}th of @var{n} to stdout
 r/@var{n}like @samp{l} but use round robin distribution
-r/@var{k}/@var{n}  likewise but only output @var{k}th of @var{n} to stdout
+r/@var{k}/@var{n}  likewise but output only @var{k}th of @var{n} to stdout
 @end example
 
 Any excess bytes remaining after dividing the @var{input}
@@ -4050,7 +4051,7 @@ for reading standard input when standard input is a terminal.
 @item -c
 @itemx --check
 Read file names and checksum information (not data) from each
-@var{file} (or from stdin if no @var{file} was specified) and report
+@var{file} (or from standard input if no @var{file} was specified) and report
 whether the checksums match the contents of the named files.
 The input to this mode of @command{md5sum} is usually the output of
 a prior, checksum-generating run of @samp{md5sum}.
@@ -4579,7 +4580,7 @@ of the line being used in the sort.
 
 @item --debug
 Highlight the portion of each line used for sorting.
-Also issue warnings about questionable usage to stderr.
+Also issue warnings about questionable usage to standard error.
 
 @item --batch-size=@var{nmerge}
 @opindex --batch-size
@@ -6228,7 +6229,7 @@ $ paste num2 let3 num2
@ c
 @end example
 
-Intermix lines from stdin:
+Intermix lines from standard input:
 @example
 $ paste - let3 - < num2
 1   a  2
@@ -9186,7 +9187,7 @@ The @var{level} value can be one of the following:
 
 @item none
 @opindex none @r{dd status=}
-Do not print any informational or warning messages to stderr.
+Do not print any informational or warning messages to standard error.
 Error messages are output as normal.
 
 @item noxfer
@@ -9196,14 +9197,14 @@ that normally make up the last status line.
 
 @item progress
 @opindex progress @r{dd status=}
-Print the transfer rate and volume statistics on stderr,
+Print the transfer rate and volume statistics on standard error,
 when processing each input block.  Statistics are output
 on a single line at most once every second, but updates
 can be delayed when waiting on I/O.
 
 @end table
 
-Transfer information is normally output to stderr upon
+Transfer information is normally output to standard error upon
 receipt of the @samp{INFO} signal or when @command{dd} exits,
 and defaults to the following form in the C locale:
 
@@ -13837,7 +13838,7 @@ it's described here.
 @pindex tee
 @cindex pipe fitting
 @cindex destinations, multiple output
-@cindex read from stdin and write to stdout and files
+@cindex read from standard input and write to standard output and files
 
 The @command{tee} command copies standard input to standard output and also
 to any files given as arguments.  This is useful when you want not only
@@ -13941,7 +13942,7 @@ so it works with @command{zsh}, @command{bash}, and @command{ksh},
 but not with @command{/bin/sh}.  So if you write code like this
 in a shell script, be sure to start the script with @samp{#!/bin/bash}.
 
-Note also that if any of the process substitutions (or piped stdout)
+Note also that if any of the process substitutions (or piped standard output)
 might exit early without consuming all the data, the @option{-p} option
 is needed to allow @command{tee} to c