Re: More C errors by default in GCC 14 (implicit function declarations etc.)

Sam James <[email protected]> Tue, 18 Apr 2023 15:37:41 +0100
Newsgroups dev.linux.lists.c-std-porting
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Neal Gompa <[email protected]> writes:

> On Tue, Apr 18, 2023 at 9:42=E2=80=AFAM Jan Engelhardt <[email protected]> =
wrote:
>>
>>
>> On Tuesday 2023-04-18 15:19, Neal Gompa wrote:
>> >On Tue, Apr 18, 2023 at 8:36=E2=80=AFAM Florian Weimer <fweimer@redhat.=
com> wrote:
>> >>
>> >> TL;DR: I want to propose a GCC 14 change which will impact
>> >> distributions, so I'd like to gather some feedback from OpenSUSE.
>> >>
>> >> Specifically, I'm investigating the following changes:
>> >>
>> >> * -Werror=3Dimplicit-function-declaration
>> >> * -Werror=3Dimplict-int
>> >> * (tentative) -Werror=3Dint-conversion
>> >> * (very tentative) -Werror=3Dincompatible-pointer-types
>> >> * For -Wdiscarded-qualifies
>> >>
>> >> I want to propose at least the first two for GCC 14.
>>
>> Might as well enable all of it at once, then the community only needs
>> one pass per defective software.
>>
>
> I would also like to reiterate this point. The worst thing you can do
> is slow-roll changes like this. Being punched in the face once is
> better than being punched in the face several times in succession.
> Having to deal with this in Fedora, I would really rather not do it
> over and over and over if we can do it all at once.
>
> (Yes, I really feel like dealing with these changes is equivalent to
> getting punched in the face. I dealt with them far too much with my
> C++ packages in Fedora.)

Yeah, I can understand that point, and I'd like to do more, *but* that's
likely to only be feasible if we have at least one person from openSUSE
(ideally more!) championing it and doing tests with some of the flags
(Florian and I can share our setups - they're quite different to each
other, etc if needed).

It (broadly) consists of doing a full rebuild with some strict flags
and deciding on a method of obtaining the errors and capturing them
(might use a compiler wrapper, might use a patched GCC like Fedora is,
might try to grep logs in the build dir afterwards, etc).

If we had someone else helping out with this with some of these
additional warnings, it becomes more realistic for us to try target it.

In Gentoo, we're already partly doing this because Clang 16 made most
of these changes already, but I'm prioritising the bugs with warnings
that I know GCC is likely to make fatal soon too.

From=20what I've seen, -Wint-conversion and -Wincompatible-pointer-types
are much rarer, but they also sometimes require more analysis to fix.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZD6sH18UgAAAAAAuAChp
c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB
NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv
by5vcmcACgkQc4QJ9SDfkZDZhQEAz2nRyjEwEmhvOR90xle6PKgti1NWGPCEkFk3
VdT9lMwBAONTj9jaMMpdUuaVmsFOVybQqOXaUvWj+bCqF3LY9VcE
=0eje
-----END PGP SIGNATURE-----
--=-=-=--