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

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 17:06:36 PST 2015


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;




More information about the cfe-commits mailing list