> But we don't. Wonder if in addition to your patch or instead of it it > wouldn't be safer (especially for FEs added in the future) to: > > /* If we see "return;" in some basic block, then we do reach the end > without returning a value. */ > - else if (warn_return_type > + else if (warn_return_type > 0 > && !TREE_NO_WARNING (fun->decl) > && EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (fun)->preds) > 0 > && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fun->decl)))) > > in tree-cfg.c. That change is preapproved if it works, and your > patch if you want in addition to that is ok too.
That's the first thing I tried and it indeed works. -- Eric Botcazou