This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [1of5] looking for feedback on Wcoercion warning (for stage1)


(The following patch implements part of the functionality of the
Wcoercion project as explained in
http://gcc.gnu.org/wiki/Wcoercion#Background ).

This patch adds two additional warning options: Wtradtional-conversion
and Wcoercion. These are added for the sake of clarity (in order to
distinguish them from
the current Wconversion). Then, the current functionality of
Wconversion is divided into the two new flags, as appropriate:

a) Wtraditional-conversion: warn if a prototype causes a type
conversion that is different from what would happen to the same
argument in the absence of a prototype;

b) Wcoercion: warn if a negative integer constant expression is
implicitly converted to an unsigned type. For example, warn about the
assignment x = -1 if x is unsigned. But do not warn about explicit
casts like (unsigned) -1.

This is the first of a series of 5 patches.

Bootstrapped and tested with --enable-languages=all for trunk revision
115951 on i686-pc-linux-gnu

:ADDPATCH c/c++:
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/c-common.c 1of3-split/gcc/c-common.c
--- pristine/gcc/c-common.c	2006-08-05 17:30:10.000000000 +0100
+++ 1of3-split/gcc/c-common.c	2006-08-05 18:05:20.000000000 +0100
@@ -949,7 +949,7 @@ overflow_warning (tree value)
 }
 
 /* Print a warning if a large constant is truncated to unsigned,
-   or if -Wconversion is used and a constant < 0 is converted to unsigned.
+   or if -Wcoercion is used and a constant < 0 is converted to unsigned.
    Invoke this function on every expression that might be implicitly
    converted to an unsigned type.  */
 
@@ -969,7 +969,7 @@ unsigned_conversion_warning (tree result
 	warning (OPT_Woverflow,
 		 "large integer implicitly truncated to unsigned type");
       else
-	warning (OPT_Wconversion,
+	warning (OPT_Wcoercion,
 		 "negative integer implicitly converted to unsigned type");
     }
 }
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/c.opt 1of3-split/gcc/c.opt
--- pristine/gcc/c.opt	2006-06-04 09:53:03.000000000 +0100
+++ 1of3-split/gcc/c.opt	2006-08-05 18:05:20.000000000 +0100
@@ -141,6 +141,10 @@ Wchar-subscripts
 C ObjC C++ ObjC++ Var(warn_char_subscripts)
 Warn about subscripts whose type is \"char\"
 
+Wcoercion
+C ObjC C++ ObjC++ Var(warn_coercion)
+Warn for implicit type conversions that may change a value
+
 Wcomment
 C ObjC C++ ObjC++
 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
@@ -150,8 +154,12 @@ C ObjC C++ ObjC++
 Synonym for -Wcomment
 
 Wconversion
-C ObjC C++ ObjC++ Var(warn_conversion)
-Warn about possibly confusing type conversions
+C++ ObjC++ Var(warn_conversion)
+Undocumented
+
+Wtraditional-conversion
+C ObjC Var(warn_traditional_conversion)
+Warn of prototypes causing type conversions different from what would happen in the absence of prototype
 
 Wctor-dtor-privacy
 C++ ObjC++ Var(warn_ctor_dtor_privacy)
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/c-typeck.c 1of3-split/gcc/c-typeck.c
--- pristine/gcc/c-typeck.c	2006-08-07 20:13:06.000000000 +0100
+++ 1of3-split/gcc/c-typeck.c	2006-08-05 18:05:20.000000000 +0100
@@ -2390,7 +2390,7 @@ convert_arguments (tree typelist, tree v
 	    {
 	      /* Optionally warn about conversions that
 		 differ from the default conversions.  */
-	      if (warn_conversion || warn_traditional)
+	      if (warn_traditional_conversion || warn_traditional)
 		{
 		  unsigned int formal_prec = TYPE_PRECISION (type);
 
@@ -2466,8 +2466,8 @@ convert_arguments (tree typelist, tree v
 		    }
 		  /* Detect integer changing in width or signedness.
 		     These warnings are only activated with
-		     -Wconversion, not with -Wtraditional.  */
-		  else if (warn_conversion && INTEGRAL_TYPE_P (type)
+		     -Wtraditional-conversion, not with -Wtraditional.  */
+		  else if (warn_traditional_conversion && INTEGRAL_TYPE_P (type)
 			   && INTEGRAL_TYPE_P (TREE_TYPE (val)))
 		    {
 		      tree would_have_been = default_conversion (val);
@@ -2480,7 +2480,7 @@ convert_arguments (tree typelist, tree v
 			   and the actual arg is that enum type.  */
 			;
 		      else if (formal_prec != TYPE_PRECISION (type1))
-			warning (OPT_Wconversion, "passing argument %d of %qE "
+			warning (OPT_Wtraditional_conversion, "passing argument %d of %qE "
 				 "with different width due to prototype",
 				 argnum, rname);
 		      else if (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (type1))
@@ -2503,11 +2503,11 @@ convert_arguments (tree typelist, tree v
 			       && TYPE_UNSIGNED (TREE_TYPE (val)))
 			;
 		      else if (TYPE_UNSIGNED (type))
-			warning (OPT_Wconversion, "passing argument %d of %qE "
+			warning (OPT_Wtraditional_conversion, "passing argument %d of %qE "
 				 "as unsigned due to prototype",
 				 argnum, rname);
 		      else
-			warning (OPT_Wconversion, "passing argument %d of %qE "
+			warning (OPT_Wtraditional_conversion, "passing argument %d of %qE "
 				 "as signed due to prototype", argnum, rname);
 		    }
 		}
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/doc/invoke.texi 1of3-split/gcc/doc/invoke.texi
--- pristine/gcc/doc/invoke.texi	2006-08-05 17:30:41.000000000 +0100
+++ 1of3-split/gcc/doc/invoke.texi	2006-08-07 20:05:37.000000000 +0100
@@ -223,8 +223,8 @@ Objective-C and Objective-C++ Dialects}.
 @xref{Warning Options,,Options to Request or Suppress Warnings}.
 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
 -w  -Wextra  -Wall  -Waggregate-return -Walways-true -Wno-attributes @gol
--Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
--Wconversion  -Wno-deprecated-declarations @gol
+-Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts -Wcoercion @gol
+-Wcomment -Wtraditional-conversion  -Wno-deprecated-declarations @gol
 -Wdisabled-optimization  -Wno-div-by-zero  -Wno-endif-labels @gol
 -Werror  -Werror-* -Werror-implicit-function-declaration @gol
 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
@@ -3026,7 +3026,7 @@ traditional C case.
 Conversions by prototypes between fixed/floating point values and vice
 versa.  The absence of these prototypes when compiling with traditional
 C would cause serious problems.  This is a subset of the possible
-conversion warnings, for the full set use @option{-Wconversion}.
+conversion warnings, for the full set use @option{-Wtraditional-conversion}.
 
 @item
 Use of ISO C style function definitions.  This warning intentionally is
@@ -3114,18 +3114,21 @@ only if you have been very careful about
 declarations and prototypes.  Otherwise, it will just be a nuisance;
 this is why we did not make @option{-Wall} request these warnings.
 
-@item -Wconversion
-@opindex Wconversion
+@item -Wtraditional-conversion
+@opindex Wtraditional-conversion
 Warn if a prototype causes a type conversion that is different from what
 would happen to the same argument in the absence of a prototype.  This
 includes conversions of fixed point to floating and vice versa, and
 conversions changing the width or signedness of a fixed point argument
 except when the same as the default promotion.
 
-Also, warn if a negative integer constant expression is implicitly
-converted to an unsigned type.  For example, warn about the assignment
-@code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
-casts like @code{(unsigned) -1}.
+@item -Wcoercion
+@opindex Wcoercion
+Warn if a negative integer constant expression is implicitly converted
+to an unsigned type.  For example, warn about the assignment
+@code{unsigned x = -1} if @code{x} is unsigned. But do not warn about
+explicit casts like @code{(unsigned) -1}.
+
 
 @item -Wsign-compare
 @opindex Wsign-compare
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/doc/trouble.texi 1of3-split/gcc/doc/trouble.texi
--- pristine/gcc/doc/trouble.texi	2006-06-11 18:02:27.000000000 +0100
+++ 1of3-split/gcc/doc/trouble.texi	2006-08-05 18:05:19.000000000 +0100
@@ -985,10 +985,10 @@ you are removing prototypes that were ma
 the program worked before without any prototypes, it will work again
 without them.
 
-@opindex Wconversion
+@opindex Wtraditional-conversion
 You can find all the places where this problem might occur by compiling
-the program with the @option{-Wconversion} option.  It prints a warning
-whenever an argument is converted.
+the program with the @option{-Wtraditional-conversion} option.  It
+prints a warning whenever an argument is converted.
 
 @item
 Both conversion programs can be confused if there are macro calls in and
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/builtin-protos-1.c 1of3-split/gcc/testsuite/gcc.dg/builtin-protos-1.c
--- pristine/gcc/testsuite/gcc.dg/builtin-protos-1.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/builtin-protos-1.c	2006-08-05 18:05:20.000000000 +0100
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options -Wconversion } */
+/* { dg-options -Wtraditional-conversion } */
 
 int
 test_s (signed int x)
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/dfp/Wconversion-2.c 1of3-split/gcc/testsuite/gcc.dg/dfp/Wconversion-2.c
--- pristine/gcc/testsuite/gcc.dg/dfp/Wconversion-2.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/dfp/Wconversion-2.c	2006-08-05 18:05:19.000000000 +0100
@@ -1,6 +1,6 @@
-/* Test messages for -Wconversion (based on gcc.dg/Wconversion-2.c).  */
+/* Test messages for -Wtraditional-conversion (based on gcc.dg/Wconversion-2.c).  */
 /* { dg-do compile } */
-/* { dg-options "-std=gnu99 -Wconversion" } */
+/* { dg-options "-std=gnu99 -Wtraditional-conversion" } */
 
 void fsi(signed int);
 void fd32(_Decimal32);
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/overflow-warn-1.c 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-1.c
--- pristine/gcc/testsuite/gcc.dg/overflow-warn-1.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-1.c	2006-08-05 18:05:20.000000000 +0100
@@ -102,7 +102,7 @@ void
 h2i (int x)
 {
   /* For some reason, we only give certain warnings for implicit
-     conversions among values of the same precision with -Wconversion,
+     conversions among values of the same precision with -Wcoercion,
      while we don't give others at all.  */
   fsi ((unsigned)INT_MAX + 1);
   si = (unsigned)INT_MAX + 1;
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/overflow-warn-2.c 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-2.c
--- pristine/gcc/testsuite/gcc.dg/overflow-warn-2.c	2006-06-04 09:53:03.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-2.c	2006-08-05 18:05:20.000000000 +0100
@@ -1,7 +1,7 @@
-/* Test for diagnostics for constant overflow.  Test with -Wconversion.  */
+/* Test for diagnostics for constant overflow.  Test with -Wtraditional-conversion.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-std=c99 -Wconversion" } */
+/* { dg-options "-std=c99 -Wtraditional-conversion" } */
 
 #include <limits.h>
 
@@ -82,23 +82,23 @@ void
 h2 (void)
 {
   fsc (SCHAR_MAX + 1);
-  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 84 } */
+  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 84 } */
   fsc (SCHAR_MIN - 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */
-  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 86 } */
+  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 86 } */
   fsc (UCHAR_MAX);
-  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 88 } */
+  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 88 } */
   fsc (UCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */
-  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 90 } */
-  fuc (-1); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 92 } */
+  /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 90 } */
+  fuc (-1);
+  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 92 } */
   fuc (UCHAR_MAX + 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 94 } */
-  fuc (SCHAR_MIN); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 96 } */
+  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 94 } */
+  fuc (SCHAR_MIN);
+  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 96 } */
   fuc (SCHAR_MIN - 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 98 } */
+  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 98 } */
   fuc (-UCHAR_MAX); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 100 } */
+  /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 100 } */
 }
 
 void fui (unsigned int);
@@ -111,7 +111,7 @@ void
 h2i (int x)
 {
   /* For some reason, we only give certain warnings for implicit
-     conversions among values of the same precision with -Wconversion,
+     conversions among values of the same precision with -Wtraditional-conversion,
      while we don't give others at all.  */
   fsi ((unsigned)INT_MAX + 1); /* { dg-warning "warning: passing argument 1 of 'fsi' as signed due to prototype" } */
   si = (unsigned)INT_MAX + 1;
@@ -121,12 +121,12 @@ h2i (int x)
   si = x ? (unsigned)INT_MAX + 2 : 1;
   fsi (UINT_MAX); /* { dg-warning "warning: passing argument 1 of 'fsi' as signed due to prototype" } */
   si = UINT_MAX;
-  fui (-1); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wconversion" { target *-*-* } 124 } */
-  ui = -1; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  ui = x ? -1 : 1U; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  fui (INT_MIN); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wconversion" { target *-*-* } 128 } */
-  ui = INT_MIN; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
-  ui = x ? INT_MIN : 1U; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */
+  fui (-1);
+  /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wtraditional-conversion" { target *-*-* } 124 } */
+  ui = -1;
+  ui = x ? -1 : 1U;
+  fui (INT_MIN);
+  /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wtraditional-conversion" { target *-*-* } 128 } */
+  ui = INT_MIN;
+  ui = x ? INT_MIN : 1U;
 }
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/overflow-warn-3.c 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-3.c
--- pristine/gcc/testsuite/gcc.dg/overflow-warn-3.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-3.c	2006-08-05 18:05:20.000000000 +0100
@@ -109,7 +109,7 @@ void
 h2i (int x)
 {
   /* For some reason, we only give certain warnings for implicit
-     conversions among values of the same precision with -Wconversion,
+     conversions among values of the same precision with -Wcoercion,
      while we don't give others at all.  */
   fsi ((unsigned)INT_MAX + 1);
   si = (unsigned)INT_MAX + 1;
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/overflow-warn-4.c 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-4.c
--- pristine/gcc/testsuite/gcc.dg/overflow-warn-4.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/overflow-warn-4.c	2006-08-05 18:05:20.000000000 +0100
@@ -109,7 +109,7 @@ void
 h2i (int x)
 {
   /* For some reason, we only give certain warnings for implicit
-     conversions among values of the same precision with -Wconversion,
+     conversions among values of the same precision with -Wcoercion
      while we don't give others at all.  */
   fsi ((unsigned)INT_MAX + 1);
   si = (unsigned)INT_MAX + 1;
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/Wcoercion-negative-constants.c 1of3-split/gcc/testsuite/gcc.dg/Wcoercion-negative-constants.c
--- pristine/gcc/testsuite/gcc.dg/Wcoercion-negative-constants.c	1970-01-01 01:00:00.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/Wcoercion-negative-constants.c	2006-08-06 16:22:01.000000000 +0100
@@ -0,0 +1,57 @@
+/* Test for diagnostics for negative constants coerced to unsigned types
+   These tests come from gcc/testsuite/gcc.dg/overflow-warn-2.c
+   Origin: Manuel Lopez-Ibanez <lopezibanez@gmail.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wcoercion" } */
+
+#include <limits.h>
+
+void fuc (unsigned char);
+
+void hc (int x)
+{
+  unsigned char uc;
+
+  fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  uc = x ? 1U : -1;
+  /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 18 } */
+  uc = x ? SCHAR_MIN : 1U;
+  /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 20 } */
+  uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+
+  fuc('A');
+  uc = 'A';
+
+  uc = x ? 1 : -1;
+
+  uc = x ? SCHAR_MIN : 1;
+}
+
+unsigned fui (unsigned int ui);
+
+void hi (int x)
+{
+  unsigned ui;
+
+  fui (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  ui = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+
+  ui = -1 * (1 * -1);
+  ui = (unsigned) -1;
+
+  ui = x ? 1 : -1;
+
+  ui = x ? INT_MIN : 1;
+
+  ui = ui ? SCHAR_MIN : 1;
+}
+
+
+unsigned fui(unsigned a) { return a + -1; } /* { dg-warning "negative integer implicitly converted to unsigned type" } */
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/Wconversion-2.c 1of3-split/gcc/testsuite/gcc.dg/Wconversion-2.c
--- pristine/gcc/testsuite/gcc.dg/Wconversion-2.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/Wconversion-2.c	2006-08-05 18:05:20.000000000 +0100
@@ -1,8 +1,8 @@
-/* Test messages for -Wconversion, including that they are not
+/* Test messages for -Wtraditional-conversion, including that they are not
    pedwarns.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "-std=c99 -pedantic-errors -Wconversion" } */
+/* { dg-options "-std=c99 -pedantic-errors -Wtraditional-conversion" } */
 
 void fsc(signed char);
 void fsi(signed int);
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/Wconversion-3.c 1of3-split/gcc/testsuite/gcc.dg/Wconversion-3.c
--- pristine/gcc/testsuite/gcc.dg/Wconversion-3.c	2006-06-04 09:53:03.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/Wconversion-3.c	2006-08-05 18:05:20.000000000 +0100
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wconversion" } */
+/* { dg-options "-O2 -Wcoercion" } */
 
 unsigned f(unsigned a) { return a + -1; }  /* { dg-warning "negative" } */
 
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/gcc.dg/Wconversion.c 1of3-split/gcc/testsuite/gcc.dg/Wconversion.c
--- pristine/gcc/testsuite/gcc.dg/Wconversion.c	2006-06-15 19:07:10.000000000 +0100
+++ 1of3-split/gcc/testsuite/gcc.dg/Wconversion.c	2006-08-05 18:05:20.000000000 +0100
@@ -5,7 +5,7 @@
    not used in the appropriate place in the warning code.  */
 
 /* { dg-do compile } */
-/* { dg-options -Wconversion } */
+/* { dg-options -Wtraditional-conversion } */
 
 typedef enum { a } __attribute__((packed)) t;
 void f(t x) {}
diff -Ebpaur --unidirectional-new-file --exclude='*svn*' --exclude='#*' --exclude='*~' pristine/gcc/testsuite/g++.old-deja/g++.other/warn4.C 1of3-split/gcc/testsuite/g++.old-deja/g++.other/warn4.C
--- pristine/gcc/testsuite/g++.old-deja/g++.other/warn4.C	2006-06-07 00:57:15.000000000 +0100
+++ 1of3-split/gcc/testsuite/g++.old-deja/g++.other/warn4.C	2006-08-05 18:05:20.000000000 +0100
@@ -1,5 +1,5 @@
 // { dg-do assemble  }
-// { dg-options "-Wconversion" }
+// { dg-options "-Wcoercion" }
 
 // Copyright (C) 1999 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]