From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2b.google.com (mail-vk1-xa2b.google.com [IPv6:2607:f8b0:4864:20::a2b]) by sourceware.org (Postfix) with ESMTPS id 9598F3858C31 for ; Wed, 10 May 2023 10:40:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9598F3858C31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gwmail.gwu.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gwmail.gwu.edu Received: by mail-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-452f317e304so1138000e0c.2 for ; Wed, 10 May 2023 03:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gwmail.gwu.edu; s=google; t=1683715256; x=1686307256; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PkCVJSlwTsCyVQqt39MP5Z2NEqWY6T+xRcjF5l+bhXo=; b=WluU1eA/V6QdSxQqeNuM90kEB3V4cLB+wZPpv53wTv54g+MLHvQNG2v081MzoEb5vZ q2xWXGTBigVoutYl6eoAS1xjgFSOgktjT2Xa/NdKkHTitV2zFvXsiKTObI9JkWtXidCh CEQn3doSSn94v7sAEZ8Mvt6MD8eK+xgFutAQSSiURMsq+EbX9NJoJMAThLp2dr0uUGmD NpXOfQfQDS+oZM/kFPFQuz8CardTwUiHfmQkQRcdwKpYasj2rRLL+yl0b3o6WviNfvf5 ewiiJ19TERcxjupVCtw54pqfRv+MQR6LiU3GSj3TTaHSMskY513gIyI66/G0yTVS+TjT Q7Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683715256; x=1686307256; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PkCVJSlwTsCyVQqt39MP5Z2NEqWY6T+xRcjF5l+bhXo=; b=ImhKluSJRRsRY3u4UayCUd2Futqkb6Lszb4avRxS3sKLhf5zw4aHeB50nENwDO3WBn IIp9xLPZ0QKiJSH7Yt8ScUZbVWreewlTP8RAq/47maDVAcjFxplo6bqULJOw1VPjTgNi ol5/9FARzCLvhXpF4CdSIQ9nnKSiv0MCJo9qoYWybS03IjeyakjVCjfbYpiAROUerD3H 9ziAOI+Vsli8eEjFdGDys4nz7KrgiGC6OIoVWOLYROCigcsUf2EMjMox1crqyGhvkaVz mzUwzWq8ItLd220aiO0PYx0NjGQuDB2ZKIY/DFrDzLuLUMoI1rxSnI/7ZY7XXKFTe8BS N2WQ== X-Gm-Message-State: AC+VfDxizCYBhvh7g8UktP0Dr6X9wHmhO4jUb4XcL3TCWRifrLeTb2t0 Xkd0JQO9LM+l8Pc5MNz003jQv5O82lPhaLJ2I+xj1w== X-Google-Smtp-Source: ACHHUZ780qYy6YTttRhvpxNUrqPP8XBmjd/C0e5myPqQ6I29txBwko6t9Ypr7/QrUgnK9X4oFze/V2cnE8QsKby7b7E= X-Received: by 2002:a1f:c112:0:b0:44f:ff7f:75df with SMTP id r18-20020a1fc112000000b0044fff7f75dfmr4841131vkf.11.1683715255839; Wed, 10 May 2023 03:40:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a59:c046:0:b0:3ca:d638:7c49 with HTTP; Wed, 10 May 2023 03:40:54 -0700 (PDT) In-Reply-To: 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> From: Eric Gallager Date: Wed, 10 May 2023 06:40:54 -0400 Message-ID: Subject: Re: More C type errors by default for GCC 14 To: Jonathan Wakely Cc: joel@rtems.org, David Edelsohn , Eli Zaretskii , Jakub Jelinek , =?UTF-8?Q?Arsen_Arsenovi=C4=87?= , "gcc@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,JMQ_SPF_NEUTRAL,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 am a bit gun shy because I remember the move from GCC 3.3 to 3.4 >> where the improved strict alias checking gave us a LOT of warnings to >> deal with and it felt overwhelming. I don't want to do that again. >> >> But I believe in letting the compiler get stricter and find things. >> Defaulting >> to stricter checking is a good thing. > > The checks are already done, they're just warnings by default, and so > easily missed/ignored when compiling large code bases. >