[cfe-commits] [patch] Fixing miscellaneous warnings in libc++ headers

Dimitry Andric dimitry at andric.com
Mon Oct 22 05:21:59 PDT 2012


This patch fixes a few minor other warnings that occur in libc++'s
headers, when building with -Wsystem-headers.

In include/cmath:

   In file included from /usr/include/c++/v1/ccomplex:21:
   In file included from /usr/include/c++/v1/complex:246:
   /usr/include/c++/v1/cmath:1204:9: warning: 'FP_FAST_FMAF' macro redefined
   #define FP_FAST_FMAF
           ^
   /usr/include/math.h:71:9: note: previous definition is here
   #define FP_FAST_FMAF    1
           ^

On FreeBSD, this symbol is already defined in the system headers, so to
fix the warning, add guards.

In include/ccomplex:

   In file included from /usr/include/c++/v1/ccomplex:21:
   /usr/include/c++/v1/complex:1253:13: warning: add explicit braces to avoid dangling else [-Wdangling-else]
               else
               ^

This can be fixed by adding a pair of braces in the right place.

In incldue/ext/hash_map:

   In file included from /usr/include/c++/v1/ext/hash_map:206:
   /usr/include/c++/v1/ext/__hash:45:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
   #endif _LIBCPP_EXT_HASH
          ^

This is just a typo, which can be fixed by adding //.

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


More information about the cfe-commits mailing list