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: [patch] Avoid generating warnings for -O2 -Wunreachable-code


On Fri, Nov 6, 2009 at 6:41 AM, Eric Fisher <joefoxreal@gmail.com> wrote:
> 2009/11/5 Richard Guenther <richard.guenther@gmail.com>:
>>
>> The patch should retain -Wunreachable-code as a no-op
>> for backward compatibility. ?And it needs a changelog ;)
>>
>> The patch is ok to apply in a week if nobody raises serious objections.
>>
>> Thanks,
>> Richard.
>>
>
> I have modified the patch to retain the option -Wunreachable-code as a
> no-op. The patch was tested on my x86 platform.
>
> Is it OK?

You should remove the flags variable and the option kind

>  Wunreachable-code
>  Common Var(warn_notreached) Warning
> -Warn about code that will never be executed
> +This option is not supported and just retains here for backword compatibility.

Thus just

Wunreachable-code
Common
Does nothing.  Preserved for backward compatibility.

which is the canonical description for backward compatibility
options.

Please try specifying -Wunreachable-code after that patch,
if it ICEs you have to add it to the backward compatibility
flag section in opts.c:common_handle_option.

The patch is ok with that change if it still passes bootstrap
after a week to let people complain.

Thanks,
Richard.


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