(C++) -Wold-style-cast tweak

Jason Merrill jason@cygnus.com
Fri Jul 9 12:44:00 GMT 1999


1999-07-09  Jason Merrill  <jason@yorick.cygnus.com>

	* decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
	casts in system headers or extern "C" blocks.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.222
diff -c -p -r1.222 decl2.c
*** decl2.c	1999/07/07 00:32:23	1.222
--- decl2.c	1999/07/09 19:39:38
*************** reparse_absdcl_as_casts (decl, expr)
*** 3818,3824 ****
        expr = build_c_cast (type, expr);
      }
  
!   if (warn_old_style_cast)
      warning ("use of old-style cast");
  
    return expr;
--- 3811,3818 ----
        expr = build_c_cast (type, expr);
      }
  
!   if (warn_old_style_cast && ! in_system_header
!       && current_lang_name != lang_name_c)
      warning ("use of old-style cast");
  
    return expr;


More information about the Gcc-patches mailing list