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]

Re: [warnings] attribs.c


On Thu, 12 May 2005, DJ Delorie wrote:

> Note that I didn't see any tests that explicitly tested -Wfoo,
> -Wno-foo, and default for any -Wfoo.  I didn't look *that* hard
> either, though.

Wint-to-pointer-cast-*, Wpointer-to-int-cast-*.

> -  if (warn_traditional && !in_system_header && lookup_name (name))
> -    warning (0, "%Htraditional C lacks a separate namespace for labels, "
> +  if (!in_system_header && lookup_name (name))
> +    warning (Wtraditional, "%Htraditional C lacks a separate namespace for labels, "
>               "identifier %qE conflicts", &location, name);

OPT_ missing.

> -	  if (params == 0 && (warn_format_nonliteral || warn_format_security))
> -	    warning (0, "format not a string literal and no format arguments");
> -	  else if (warn_format_nonliteral)
> -	    warning (0, "format not a string literal, argument types not checked");
> +	  if (params == 0 && warn_format_security)
> +	    warning (OPT_Wformat_security, "format not a string literal and no format arguments");
> +	  if (params == 0 && warn_format_nonliteral)
> +	    warning (OPT_Wformat_nonliteral, "format not a string literal and no format arguments");

Should avoid warning twice when both options are on.

> @@ -659,8 +659,8 @@ decode_options (unsigned int argc, const
>        /* The c_decode_option function and decode_option hook set
>  	 this to `2' if -Wall is used, so we can avoid giving out
>  	 lots of errors for people who don't realize what -Wall does.  */
> -      if (warn_uninitialized == 1)
> -	warning (0, "-Wuninitialized is not supported without -O");
> +      warning (OPT_Wuninitialized,
> +	       "-Wuninitialized is not supported without -O");

This appears to change the logic if warn_uninitialized == 2.  Either the 
logic should be preserved or if the comment is wrong it should be 
corrected.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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