summaryrefslogtreecommitdiff
path: root/cppunit/cppunit-1.12.1-warnings.patch
blob: c2429d714f1a6e3f312848ef5b9577b73a3beba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- misc/cppunit-1.12.1/include/cppunit/TestAssert.h	2012-02-10 12:34:26.564961982 +0100
+++ misc/build/cppunit-1.12.1/include/cppunit/TestAssert.h	2012-02-10 12:33:57.660131866 +0100
@@ -8,6 +8,12 @@
 #include <stdio.h>
 #include <float.h> // For struct assertion_traits<double>
 
+// Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T
+// is an enum type:
+#if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6))
+#pragma GCC system_header
+#endif
+
 
 CPPUNIT_NS_BEGIN
 
@@ -46,7 +52,16 @@
     static std::string toString( const T& x )
     {
         OStringStream ost;
+// Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T
+// is an enum type:
+#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsign-promo"
+#endif
         ost << x;
+#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
+#pragma GCC diagnostic pop
+#endif
         return ost.str();
     }
 };