[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mbsrtowcs-state.c, wcsrtombs-state.c: avoid compilation fail

From: Ben Pfaff
Subject: Re: [PATCH] mbsrtowcs-state.c, wcsrtombs-state.c: avoid compilation failure
Date: Tue, 28 Apr 2009 10:07:33 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Eric Blake <address@hidden> writes:

> Jim Meyering <jim <at> 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 scalar type may optionally be
enclosed in braces.  From C99 6.7.8 "Initialization", paragraph

        The initializer for a scalar shall be a single
        expression, optionally enclosed in braces.

C89 had similar text.
"To the engineer, the world is a toy box full of sub-optimized and
 feature-poor toys."
--Scott Adams

reply via email to

[Prev in Thread] Current Thread [Next in Thread]