[libcxx] r254050 - Silence a -Wmissing-braces warning in the tests; mbstate_t is defined differently on different C libraries.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 17:38:23 PST 2015


Could this initialization just be written as "mbstate_t mb = {}" & avoid
the warning entirely (I'm not entirely sure what the warning was, but I
imagine that'd avoid it)

On Tue, Nov 24, 2015 at 5:06 PM, Marshall Clow via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: marshall
> Date: Tue Nov 24 19:06:36 2015
> New Revision: 254050
>
> URL: http://llvm.org/viewvc/llvm-project?rev=254050&view=rev
> Log:
> Silence a -Wmissing-braces warning in the tests; mbstate_t is defined
> differently on different C libraries.
>
> Modified:
>     libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp
>
> Modified: libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp?rev=254050&r1=254049&r2=254050&view=diff
>
> ==============================================================================
> --- libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp (original)
> +++ libcxx/trunk/test/std/depr/depr.c.headers/wchar_h.pass.cpp Tue Nov 24
> 19:06:36 2015
> @@ -31,7 +31,15 @@
>
>  int main()
>  {
> +// mbstate_t comes from the underlying C library; it is defined (in C99)
> as:
> +//    a complete object type other than an array type that can hold the
> conversion
> +//    state information necessary to convert between sequences of
> multibyte
> +//    characters and wide characters
> +#pragma clang diagnostic push
> +#pragma clang diagnostic ignored "-Wmissing-braces"
>      mbstate_t mb = {0};
> +#pragma clang diagnostic pop
> +
>      size_t s = 0;
>      tm *tm = 0;
>      wint_t w = 0;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151124/3f38b867/attachment.html>


More information about the cfe-commits mailing list