GNU bug report logs - #50167
fixes for "fmt - -" etc.

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sun, 22 Aug 2021 20:14:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50167 in the body.
You can then email your comments to 50167 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#50167; Package coreutils. (Sun, 22 Aug 2021 20:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 22 Aug 2021 20:14:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Coreutils <bug-coreutils <at> gnu.org>
Subject: fixes for "fmt - -" etc.
Date: Sun, 22 Aug 2021 13:12:53 -0700
[Message part 1 (text/plain, inline)]
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.
[0001-doc-spell-out-stdin-stdout-stderr.patch (text/x-patch, attachment)]
[0002-maint-use-clearerr-on-stdin-when-appropriate.patch (text/x-patch, attachment)]
[0003-build-update-gnulib-submodule-to-latest.patch (text/x-patch, attachment)]
[0004-df-pacify-Wsuggest-attribute-malloc.patch (text/x-patch, attachment)]

bug closed, send any further explanations to 50167 <at> debbugs.gnu.org and Paul Eggert <eggert <at> cs.ucla.edu> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sun, 22 Aug 2021 20:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#50167; Package coreutils. (Tue, 24 Aug 2021 19:43:01 GMT) Full text and rfc822 format available.

Message #10 received at 50167 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 50167 <at> debbugs.gnu.org
Subject: Re: bug#50167: fixes for "fmt - -" etc.
Date: Tue, 24 Aug 2021 21:42:30 +0200
[Message part 1 (text/plain, inline)]
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 <https://www.gnu.org/licenses/>.  */
>
> -extern char *find_mount_point (char const *, struct stat const *);
> +#include <stdlib.h>
> +
> +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 <stdlib.h>
  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
[0001-maint-avoid-sc_system_h_headers-error.patch (text/x-patch, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#50167; Package coreutils. (Tue, 24 Aug 2021 21:10:01 GMT) Full text and rfc822 format available.

Message #13 received at 50167 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: 50167 <at> debbugs.gnu.org
Subject: Re: bug#50167: fixes for "fmt - -" etc.
Date: Tue, 24 Aug 2021 14:09:36 -0700
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 <stdlib.h>" 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?




Information forwarded to bug-coreutils <at> gnu.org:
bug#50167; Package coreutils. (Wed, 25 Aug 2021 08:39:02 GMT) Full text and rfc822 format available.

Message #16 received at 50167 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Bernhard Voelker <mail <at> bernhard-voelker.de>, 50167 <at> debbugs.gnu.org
Subject: Re: bug#50167: fixes for "fmt - -" etc.
Date: Wed, 25 Aug 2021 10:38:13 +0200
[Message part 1 (text/plain, inline)]
On Tue, Aug 24, 2021 at 11:10 PM Paul Eggert <eggert <at> cs.ucla.edu> 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 <stdlib.h>" 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 (application/octet-stream, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#50167; Package coreutils. (Wed, 25 Aug 2021 14:38:02 GMT) Full text and rfc822 format available.

Message #19 received at 50167 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Jim Meyering <jim <at> meyering.net>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 50167 <at> debbugs.gnu.org
Subject: Re: bug#50167: fixes for "fmt - -" etc.
Date: Wed, 25 Aug 2021 16:37:02 +0200
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




Information forwarded to bug-coreutils <at> gnu.org:
bug#50167; Package coreutils. (Wed, 25 Aug 2021 19:47:02 GMT) Full text and rfc822 format available.

Message #22 received at 50167 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 50167 <at> debbugs.gnu.org
Subject: Re: bug#50167: fixes for "fmt - -" etc.
Date: Wed, 25 Aug 2021 21:46:26 +0200
[Message part 1 (text/plain, inline)]
On Wed, Aug 25, 2021, 4:37 PM Bernhard Voelker <mail <at> bernhard-voelker.de>
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.

>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Sep 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.