https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115310

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The logic that triggers is

  if (warn_about_return_type)
    permerror_opt (loc, flag_isoc99 ? OPT_Wimplicit_int
                   : (warn_return_type > 0 ? OPT_Wreturn_type
                      : OPT_Wimplicit_int),
                   "return type defaults to %<int%>");

and it's all documented this way.  We have -Werror=return-type to detect
the case "Also warn if execution may reach the end of the function
body, or if the function does not contain any return statement at all."

It would be nice if -std=gnu89 -Werror=return-type -Wno-implicit-int
would disable this particular instance about implicit int typed functions.

It's really ugly to force old code to use -fpermissive instead of the
much cleaner -std=gnu89 just because formerly, with the default of
newer -std, we only had a warning for the implicit int while with
-std=gnu89 we now get an error for it.  Did I say I dislike -fpermissive?
(which also gets you diagnostics for older compilers, so packages building
in multiple distributions get more difficult to maintain)

Reply via email to