[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-6.3 on MacOS X
From: |
Jim Meyering |
Subject: |
Re: coreutils-6.3 on MacOS X |
Date: |
Mon, 09 Oct 2006 13:56:44 +0200 |
Bruno Haible <address@hidden> wrote:
> pathchk.c:203: warning: missing braces around initializer
> pathchk.c:203: warning: (near initialization for `mbstate.__mbstate8')
>
> Here the problem is:
> mbstate_t mbstate = {0};
> ISO C 99 guarantees only that mbstate_t is not an array type; it could
> be a scalar or pointer type. The fix is therefore to use an initialization
> through memset, as in mbswidth.c and quotearg.c.
Thanks again.
Applied:
2006-10-09 Jim Meyering <address@hidden>
Avoid a compiler warning.
* src/pathchk.c (portable_chars_only): Initialize variable of type
mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible.
Index: src/pathchk.c
===================================================================
RCS file: /fetish/cu/src/pathchk.c,v
retrieving revision 1.88
diff -u -r1.88 pathchk.c
--- src/pathchk.c 30 May 2005 07:05:07 -0000 1.88
+++ src/pathchk.c 9 Oct 2006 11:52:26 -0000
@@ -1,5 +1,5 @@
/* pathchk -- check whether file names are valid or portable
- Copyright (C) 1991-2005 Free Software Foundation, Inc.
+ Copyright (C) 1991-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -200,8 +200,11 @@
if (*invalid)
{
- mbstate_t mbstate = {0};
- size_t charlen = mbrlen (invalid, filelen - validlen, &mbstate);
+ mbstate_t mbstate;
+ size_t charlen;
+
+ memset (&mbstate, 0, sizeof mbstate);
+ charlen = mbrlen (invalid, filelen - validlen, &mbstate);
error (0, 0,
_("nonportable character %s in file name %s"),
quotearg_n_style_mem (1, locale_quoting_style, invalid,
- coreutils-6.3 on MacOS X, Bruno Haible, 2006/10/04
- Re: coreutils-6.3 on MacOS X, Paul Eggert, 2006/10/05
- Re: coreutils-6.3 on MacOS X, Jim Meyering, 2006/10/06
- Re: coreutils-6.3 on MacOS X, Bruno Haible, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Jim Meyering, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Eric Blake, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Jim Meyering, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Eric Blake, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Jim Meyering, 2006/10/09
- Re: coreutils-6.3 on MacOS X,
Jim Meyering <=
- Re: coreutils-6.3 on MacOS X, Paul Eggert, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Jim Meyering, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Bruno Haible, 2006/10/09
- Re: coreutils-6.3 on MacOS X, Paul Eggert, 2006/10/10
- Re: coreutils-6.3 on MacOS X, Jim Meyering, 2006/10/11
- Re: gcc warnings, Bruno Haible, 2006/10/11