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: PR c++/36254 wrong "control reaches end of non-void function" warning


2008/10/23 Richard Guenther <richard.guenther@gmail.com>:
> On Thu, Oct 23, 2008 at 2:57 AM, Manuel López-Ibáñez
> <lopezibanez@gmail.com> wrote:
>> Now with patch.
>>
>> 2008/10/23 Manuel López-Ibáñez <lopezibanez@gmail.com>:
>>> This is similar case as my patch for PR 31246: more cases of
>>> compiler-generated code. In fact, there is some overlap between them.
>>>
>>> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
>>> --enable-languages=all,obj-c++ --enable-decimal-float.
>>>
>>> OK for trunk?
>
> Wherever you just set TREE_NO_WARNING or gimple_set_no_warning
> (and not propagate it) during gimplification looks fishy.

Why? As far as I understand all those cases are try/catch/finally that
the compiler constructs and wraps around user code. On the other hand,
I can try to minimize the amount of changes to those required to fix
only the bug reported, if that would make easier to approve the patch.

> It looks like for both patches it might work to just disable these warnings for
> EH related code?  (The propagation of the no-warning flag during gimplification
> _does_ look correct, though)

If the user writes a try/catch he should expect to get warnings for
things there. However, for anything generated by the compiler we
should set no_warning (and if possible DEL_ARTIFICIAL). This is
clearly not done in large parts of the compiler. And the resulting
warnings are very confusing.

Cheers,

Manuel.


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