fbstring: mute uninitialized warnings in fbstring code
authorAndrew Gallagher <agallagher@fb.com>
Wed, 8 Aug 2012 05:49:39 +0000 (22:49 -0700)
committerTudor Bosman <tudorb@fb.com>
Wed, 8 Aug 2012 22:40:16 +0000 (15:40 -0700)
Summary:
fbstring generates some apparently false positive uninitialized warnings
under gcc-4.7.1.  This diff disables the '-Wuninitialized' flag for
fbstring.

Test Plan: build

Reviewed By: ldemailly@fb.com

FB internal diff: D542722

folly/FBString.h

index 1f1e7b8dc9cc70d63b146b76a282a333bfcc29a3..3fd59ab4b1022fc4d9392939e5c9f99a21757376 100644 (file)
@@ -236,6 +236,13 @@ private:
 };
 */
 
+/**
+ * gcc-4.7 throws what appears to be some false positive uninitialized
+ * warnings for the members of the MediumLarge struct.  So, mute them here.
+ */
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wuninitialized"
+
 /**
  * This is the core of the string. The code should work on 32- and
  * 64-bit architectures and with any Char size. Porting to big endian
@@ -815,6 +822,8 @@ private:
   }
 };
 
+# pragma GCC diagnostic pop
+
 #ifndef _LIBSTDCXX_FBSTRING
 /**
  * Dummy fbstring core that uses an actual std::string. This doesn't