Patchwork [google] Add new warning -Wreal-conversion (issue4436068)

login
register
mail settings
Submitter Diego Novillo
Date April 29, 2011, 8:26 p.m.
Message ID <4DBB1EFC.2060208@google.com>
Download mbox | patch
Permalink /patch/93474/
State New
Headers show

Comments

Diego Novillo - April 29, 2011, 8:26 p.m.
On 04/29/2011 11:02 AM, Nathan Froyd wrote:
> On Fri, Apr 29, 2011 at 10:59:31AM -0400, Diego Novillo wrote:
>> 	* g++.dg/warn/Wreal-conversion-1.C: New.
>> 	* gcc.dg/Wreal-conversion-1.c: New.
>
> Could a single copy of the test be placed in c-c++-common, instead?
>
> -Nathan

Committed to google/main

2011-04-29  Diego Novillo  <dnovillo@google.com>

	* c-c++-common/Wreal-conversion-1.c: Move from gcc.dg.
	* g++.dg/warn/Wreal-conversion-1.C: Remove.

Patch

diff --git a/gcc/testsuite/c-c++-common/Wreal-conversion-1.c 
b/gcc/testsuite/c-c++-common/Wreal-conversion-1.c
new file mode 100644
index 0000000..84e7293
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wreal-conversion-1.c
@@ -0,0 +1,29 @@ 
+// { dg-do compile }
+// { dg-options "-Wreal-conversion" }
+
+#include <stddef.h>
+
+int
+func1 (int a)
+{
+  double f = a;
+  return f;			// { dg-warning "conversion to" }
+}
+
+double func3 ();
+
+void
+func2 ()
+{
+  double g = 3.2;
+  float f;
+  int t = g;			// { dg-warning "conversion to" }
+  int p;
+  p = f;			// { dg-warning "conversion to" }
+  func1 (g);			// { dg-warning "conversion to" }
+  char c = f;			// { dg-warning "conversion to" }
+  size_t s;
+  p = s;
+  int q;
+  q = func3 ();			// { dg-warning "conversion to" }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wreal-conversion-1.C 
b/gcc/testsuite/g++.dg/warn/Wreal-conversion-1.C
deleted file mode 100644
index 2079486..0000000
--- a/gcc/testsuite/g++.dg/warn/Wreal-conversion-1.C
+++ /dev/null
@@ -1,30 +0,0 @@ 
-// { dg-do compile }
-// { dg-options "-Wreal-conversion" }
-
-#include <stddef.h>
-
-int
-func1 (int a)
-{
-  double f = a;
-  return f;			// { dg-warning "conversion to" }
-}
-
-double func3 ();
-
-void
-func2 ()
-{
-  double g = 3.2;
-  float f;
-  int t = g;			// { dg-warning "conversion to" }
-  bool b = g;
-  int p;
-  p = f;			// { dg-warning "conversion to" }
-  func1 (g);			// { dg-warning "conversion to" }
-  char c = f;			// { dg-warning "conversion to" }
-  size_t s;
-  p = s;
-  int q;
-  q = func3 ();			// { dg-warning "conversion to" }
-}
diff --git a/gcc/testsuite/gcc.dg/Wreal-conversion-1.c 
b/gcc/testsuite/gcc.dg/Wreal-conversion-1.c
deleted file mode 100644
index 84e7293..0000000
--- a/gcc/testsuite/gcc.dg/Wreal-conversion-1.c
+++ /dev/null
@@ -1,29 +0,0 @@ 
-// { dg-do compile }
-// { dg-options "-Wreal-conversion" }
-
-#include <stddef.h>
-
-int
-func1 (int a)
-{
-  double f = a;
-  return f;			// { dg-warning "conversion to" }
-}
-
-double func3 ();
-
-void
-func2 ()
-{
-  double g = 3.2;
-  float f;
-  int t = g;			// { dg-warning "conversion to" }
-  int p;
-  p = f;			// { dg-warning "conversion to" }
-  func1 (g);			// { dg-warning "conversion to" }
-  char c = f;			// { dg-warning "conversion to" }
-  size_t s;
-  p = s;
-  int q;
-  q = func3 ();			// { dg-warning "conversion to" }
-}