Patch for -Wtraditional 'long' switch pedwarn

Joseph S. Myers jsm28@cam.ac.uk
Mon Jul 17 14:55:00 GMT 2000


The -Wtraditional warning for long switch expressions relates to a
correct standard C construct, and so should not be a pedwarn.  This
patch changes it to a plain warning.

C compiler bootstrapped and C testsuite run on i686-pc-linux-gnu; no
regressions.

2000-07-16  Joseph S. Myers  <jsm28@cam.ac.uk>

	* c-typeck.c (c_expand_start_case): Change -Wtraditional pedwarn
	for `long' switch expression into a plain warning.

--- c-typeck.c	Wed Jul 12 20:49:47 2000
+++ c-typeck.c.new	Sun Jul 16 12:47:43 2000
@@ -6739,7 +6739,7 @@
 	  && ! in_system_header
 	  && (type == long_integer_type_node
 	      || type == long_unsigned_type_node))
-	pedwarn ("`long' switch expression not converted to `int' in ANSI C");
+	warning ("`long' switch expression not converted to `int' in ANSI C");
 
       exp = default_conversion (exp);
       type = TREE_TYPE (exp);

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list