From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB028A5D for ; Wed, 10 May 2023 10:48:31 +0000 (UTC) References: <877cth66qb.fsf@oldenburg.str.redhat.com> <20230509102201.6aa2a7d14fdb2f1e7abff449@killthe.net> <87r0rp5uf8.fsf@aarsen.me> <83ttwla1ep.fsf@gnu.org> <83lehx9vix.fsf@gnu.org> <83fs859unu.fsf@gnu.org> User-agent: mu4e 1.10.3; emacs 29.0.90 From: Sam James To: Eric Gallager Cc: Jonathan Wakely , joel@rtems.org, David Edelsohn , Eli Zaretskii , Jakub Jelinek , Arsen =?utf-8?Q?Arsenovi=C4=87?= , gcc@gcc.gnu.org, c-std-porting@lists.linux.dev, Neal Gompa Subject: Re: More C type errors by default for GCC 14 Date: Wed, 10 May 2023 11:45:41 +0100 In-reply-to: Message-ID: <87mt2cihs6.fsf@gentoo.org> Precedence: bulk X-Mailing-List: c-std-porting@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Eric Gallager via Gcc writes: > On 5/9/23, Jonathan Wakely via Gcc wrote: >> On Tue, 9 May 2023 at 23:38, Joel Sherrill wrote: >>> We are currently using gcc 12 and specifying C11. To experiment with >>> these stricter warnings and slowly address them, would we need to build >>> with a newer C version? >> >> No, the proposed changes are to give errors (instead of warnings) for >> rules introduced in C99. GCC is just two decades late in enforcing the >> C99 rules properly! >> >> >>> What practices might the GCC community recommend to a project >>> wanting to discover the issues uncovered and slowly address them? I >> >> -Werror=implicit-int >> -Werror=implicit-function-declaration >> -Werror=int-conversion >> > > Idea for a compromise: What if, instead of flipping the switch on all > 3 of these at once, we staggered them so that each one becomes a > default in a separate release? i.e., something like: > > - GCC 14: -Werror=implicit-function-declaration gets added to the defaults > - GCC 15: -Werror=implicit-int gets added to the defaults > - GCC 16: -Werror=int-conversion gets added to the defaults > > That would give people more time to catch up on a particular warning, > rather than overwhelming them with a whole bunch all at once. Just an > idea. I think this might be more frustrating than not, althuogh I appreciate the intent. Neal Gompa wasn't keen on the idea at https://lore.kernel.org/c-std-porting/CAEg-Je8=dQo-jAdu=Od5DH+h9AQzGE_4ghzgx_ow4RyJVPwFTg@mail.gmail.com/ because it'd feel like essentially "repeated punches". Maybe it'd work with some tweaks: I would, however, be more open to GCC 14 having implicit-function-declaration,implicit-int (these are so closely related that it's not worth dividing the two up) and then say, GCC 15 having int-conversion and maybe incompatible-pointer-types. But spreading it out too much is likely counterproductive. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCZFt2el8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZAnhwEArM8fsOfP/rtxQuKvZYFGZJjLchqRzF2AkwUq YuphV90BAKgOWlAdnA6H10duPQ3VPeOeObB7/hnEEjpu0y5aqw0H =ZVZO -----END PGP SIGNATURE----- --=-=-=--