Thank you for all contributions to this thread.
Yes, mbstate_t is
a struct on: Cygwin, FreeBSD, glibc, Haiku, HP-UX, Interix, OSF/1, Solaris
a union on: MacOS X, NetBSD, OpenBSD
scalar on:AIX, IRIX, mingw
missing on: BeOS, HP-UX 11.00
So a portable initializer is {0} (not {0,} - that is
Ben Pfaff wrote:
> Eric Blake writes:
>
>> Jim Meyering meyering.net> writes:
>>> -mbstate_t _gl_mbsrtowcs_state = 0;
>>> +mbstate_t _gl_mbsrtowcs_state = { 0, };
>> Is this correct for all platforms? If I read Posix correctly, mbstate_t can
>> be
>> a numeric type rather than a struct.
>
>
Eric Blake writes:
> Jim Meyering meyering.net> writes:
>> -mbstate_t _gl_mbsrtowcs_state = 0;
>> +mbstate_t _gl_mbsrtowcs_state = { 0, };
>
> Is this correct for all platforms? If I read Posix correctly, mbstate_t can
> be
> a numeric type rather than a struct.
The initializer for an object
Jim Meyering wrote:
> Eric Blake wrote:
>> Jim Meyering meyering.net> writes:
>>> @@ -20,4 +20,4 @@
>>> #include
>>>
>>> /* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */
>>> -mbstate_t _gl_mbsrtowcs_state = 0;
>>> +mbstate_t _gl_mbsrtowcs_state = { 0, };
>>
>> Is this c
Eric Blake wrote:
> Pádraig Brady draigBrady.com> writes:
>
>> The {0,} init method works for scalar or aggregate types:
>> http://www.pixelbeat.org/programming/gcc/auto_init.html
>> Though as noted there, may give warnings.
>
> But the whole point of this patch is to silence warnings. What good
Pádraig Brady draigBrady.com> writes:
> The {0,} init method works for scalar or aggregate types:
> http://www.pixelbeat.org/programming/gcc/auto_init.html
> Though as noted there, may give warnings.
But the whole point of this patch is to silence warnings. What good is trading
one warning for
Jim Meyering meyering.net> writes:
> See his earlier commit:
>
> 2009-01-25 Bruno Haible clisp.org>
>
> Avoid link errors on MacOS X 10.3.
> * lib/mbsrtowcs-state.c (_gl_mbsrtowcs_state): Add initializer.
> * lib/wcsrtombs-state.c (_gl_wcsrtombs_state): Likewise.
The
Jim Meyering wrote:
> Eric Blake wrote:
>
>> Jim Meyering meyering.net> writes:
>>
>>> @@ -20,4 +20,4 @@
>>> #include
>>>
>>> /* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */
>>> -mbstate_t _gl_mbsrtowcs_state = 0;
>>> +mbstate_t _gl_mbsrtowcs_state = { 0, };
>> Is thi
Eric Blake wrote:
> Jim Meyering meyering.net> writes:
>
>> @@ -20,4 +20,4 @@
>> #include
>>
>> /* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */
>> -mbstate_t _gl_mbsrtowcs_state = 0;
>> +mbstate_t _gl_mbsrtowcs_state = { 0, };
>
> Is this correct for all platforms? I
Jim Meyering meyering.net> writes:
> @@ -20,4 +20,4 @@
> #include
>
> /* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */
> -mbstate_t _gl_mbsrtowcs_state = 0;
> +mbstate_t _gl_mbsrtowcs_state = { 0, };
Is this correct for all platforms? If I read Posix correctly, mbst
10 matches
Mail list logo