http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087

--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> 
2011-10-18 08:26:04 UTC ---
On Tue, 18 Oct 2011, paolo.carlini at oracle dot com wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087
> 
> Paolo Carlini <paolo.carlini at oracle dot com> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>    Last reconfirmed|                            |2011-10-18
>                  CC|                            |paolo.carlini at oracle dot
>                    |                            |com
>      Ever Confirmed|0                           |1
> 
> --- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 
> 2011-10-18 01:18:24 UTC ---
> Well, this does, it (fixes both) but I don't know if we are aiming for
> something better, no good including the whole "diagnostic.h"?!?
> 
> Index: tree-cfg.c
> ===================================================================
> --- tree-cfg.c    (revision 180119)
> +++ tree-cfg.c    (working copy)
> @@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "timevar.h"
>  #include "tree-dump.h"
>  #include "tree-pass.h"
> -#include "diagnostic-core.h"
> +#include "diagnostic.h"
>  #include "except.h"
>  #include "cfgloop.h"
>  #include "cfglayout.h"
> @@ -7380,7 +7380,8 @@ execute_warn_function_return (void)
>    else if (warn_return_type
>         && !TREE_NO_WARNING (cfun->decl)
>         && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0
> -       && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl))))
> +       && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl)))
> +       && !errorcount)
>      {
>        FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
>      {

I don't think that's good.  You'll miss the warning for subsequent
functions that do not have errors for example.

Either we want to generally supress all warnings once we emitted
an error (then this should be done in generic diagnostic machinery),
or we shouldn't bother with this.  We can make the generic machinery
track errors per function if we like to.

Reply via email to