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

--- Comment #3 from Florian Weimer <fw at gcc dot gnu.org> ---
This is just following the previous GCC behavior. For example, with GCC 11:

$ gcc -S -Werror=return-type -std=gnu89 t.c
t.c:1:1: error: return type defaults to ‘int’ [-Werror=return-type]
    1 | main () { return 0; }
      | ^~~~

I'm not sure how this is a problem in practice.

Using -Werror=return-type at the distribution level is … problematic. It's why
we split -Werror=return-mismatch from it, and only enabled the latter by
default in GCC 14.

(In reply to Richard Biener from comment #1)
> 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)

We added -fpermissive because we didn't want to change the meaning of
-std=gnu89. You can use it to get old sources to compile. But of course if you
use -Werror=… options at the same time, these old sources might not compile.
And that was true for previous GCC versions as well.

Reply via email to