[cfe-commits] [patch] Fixing warnings in libc++'s locale header

Dimitry Andric dimitry at andric.com
Mon Oct 22 03:07:47 PDT 2012


Hi,

This fixes a few warnings that occur in libc++'s headers, when building
with -Wsystem-headers:

In file included from /usr/include/c++/v1/iostream:40:
In file included from /usr/include/c++/v1/istream:156:
In file included from /usr/include/c++/v1/ostream:132:
/usr/include/c++/v1/locale:2878:25: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
         {pattern __p = {symbol, sign, none, value}; return __p;}
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/locale:2880:25: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
         {pattern __p = {symbol, sign, none, value}; return __p;}
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/locale:3194:35: error: unused variable '__et' [-Werror,-Wunused-variable]
                 ios_base::iostate __et = ios_base::goodbit;
                                   ^

The first two warnings are because money_base::pattern is declared as a
struct containing a char array, so the char array itself needs
additional braces.

The third warning is because r152501 changed some code in __do_get()'s
money_base::symbol case, which made the __et variable unnecessary.

-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcxx-fix-locale-warnings-1.diff
Type: text/x-diff
Size: 2482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121022/d17ba734/attachment.diff>


More information about the cfe-commits mailing list