From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 93A703856261 for ; Wed, 10 May 2023 16:44:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93A703856261 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683737081; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LsZdBetC5GyyAKhYkyLSJiXBEGhSfq6uaS/FtaM8Iu0=; b=BCF12Hzn3Xs3xSVYu6Q1i1tVHBsdu7+QbpK5K0GCz7XqSuceiwrKgmlCM/TPV0gSRgbJFz 2TtfG87r6yfxsHVVLKeFnnpkJS9ddxbOQf7nM75WPhp/76I3fICW6NnlWGjey38w6tMMb9 YCcMaygGWf2hFYkTV0jnqxaB8EYCKl0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-V2j7WtcNMFSaKTEiq0qq7g-1; Wed, 10 May 2023 12:44:36 -0400 X-MC-Unique: V2j7WtcNMFSaKTEiq0qq7g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B497381D1F5; Wed, 10 May 2023 16:44:36 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0E7240C2076; Wed, 10 May 2023 16:44:35 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 34AGiWsE3916525 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 10 May 2023 18:44:33 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 34AGiVrG3916524; Wed, 10 May 2023 18:44:31 +0200 Date: Wed, 10 May 2023 18:44:31 +0200 From: Jakub Jelinek To: Joel Sherrill Cc: Jonathan Wakely , David Edelsohn , Eli Zaretskii , Arsen =?utf-8?Q?Arsenovi=C4=87?= , "gcc@gcc.gnu.org" Subject: Re: More C type errors by default for GCC 14 Message-ID: Reply-To: Jakub Jelinek References: <83fs859unu.fsf@gnu.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 Wed, May 10, 2023 at 11:36:10AM -0500, Joel Sherrill wrote: > On Wed, May 10, 2023 at 10:14 AM Jakub Jelinek wrote: > > > On Wed, May 10, 2023 at 10:10:37AM -0500, Joel Sherrill wrote: > > > > > 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 > > > > > > > > > > Thanks. We already use -Wall which is documented to turn on the top two > > > as warnings at least. > > > > > > Is int-conversion turned on as part of any of the more general -W > > arguments > > > (e.g. -Wall, -Wextra, -pedantic)? It's not listed in the manual and I was > > > wondering > > > if that was right or an oversight. Given this discussion, I would have > > > expected it > > > to be in -Wall. > > > > -Wint-conversion is enabled by default. You get the warning whenever not > > using -w or -Wno-int-conversion, and error with -pedantic-errors. > > > > Thanks. That isn't clear in the manual. > > Is there a list of warnings included by default? I'm guessing that it might > be all the ones where the manual lists only -Wno-ABC. > > And again, I don't mind getting poked when the code does something > questionable or undefined. Doesn't make it easy to fix or even magically > give us all time to address the issues but better to know. awk '/^W/{w=$1;getline;if ($0 ~ /Init\(1\)/)print w}' gcc/{,*/}*.opt | sort -u Waddress-of-packed-member Waggressive-loop-optimizations Walign-commons Wanalyzer-allocation-size Wanalyzer-deref-before-check Wanalyzer-double-fclose Wanalyzer-double-free Wanalyzer-exposure-through-output-file Wanalyzer-exposure-through-uninit-copy Wanalyzer-fd-access-mode-mismatch Wanalyzer-fd-double-close Wanalyzer-fd-leak Wanalyzer-fd-phase-mismatch Wanalyzer-fd-type-mismatch Wanalyzer-fd-use-after-close Wanalyzer-fd-use-without-check Wanalyzer-file-leak Wanalyzer-free-of-non-heap Wanalyzer-imprecise-fp-arithmetic Wanalyzer-infinite-recursion Wanalyzer-jump-through-null Wanalyzer-malloc-leak Wanalyzer-mismatching-deallocation Wanalyzer-null-argument Wanalyzer-null-dereference Wanalyzer-out-of-bounds Wanalyzer-possible-null-argument Wanalyzer-possible-null-dereference Wanalyzer-putenv-of-auto-var Wanalyzer-shift-count-negative Wanalyzer-shift-count-overflow Wanalyzer-stale-setjmp-buffer Wanalyzer-tainted-allocation-size Wanalyzer-tainted-array-index Wanalyzer-tainted-assertion Wanalyzer-tainted-divisor Wanalyzer-tainted-offset Wanalyzer-tainted-size Wanalyzer-unsafe-call-within-signal-handler Wanalyzer-use-after-free Wanalyzer-use-of-pointer-in-stale-stack-frame Wanalyzer-use-of-uninitialized-value Wanalyzer-va-arg-type-mismatch Wanalyzer-va-list-exhausted Wanalyzer-va-list-leak Wanalyzer-va-list-use-after-va-end Wanalyzer-write-to-const Wanalyzer-write-to-string-literal Wattribute-alias= Wattributes Wattribute-warning Wbuiltin-declaration-mismatch Wbuiltin-macro-redefined Wc++11-extensions Wc++14-extensions Wc++17-extensions Wc++20-extensions Wc++23-extensions Wcannot-profile Wchanges-meaning Wclass-conversion Wcomplain-wrong-lang Wconversion-null Wcoverage-invalid-line-number Wcoverage-mismatch Wcpp Wdelete-incomplete Wdeprecated Wdeprecated-declarations Wdesignated-init Wdiscarded-array-qualifiers Wdiscarded-qualifiers Wdiv-by-zero Wendif-labels Wexceptions Wfree-nonheap-object Wif-not-aligned Wignored-attributes Winaccessible-base Wincompatible-pointer-types Winherited-variadic-ctor Winit-list-lifetime Wint-conversion Winterference-size Wint-to-pointer-cast Winvalid-memory-model Winvalid-offsetof Wliteral-suffix Wlto-type-mismatch Wmissing-profile Wmissing-requires Wmissing-template-keyword Wnonportable-cfstrings Wnon-template-friend WNSObject-attribute Wobjc-root-class Wodr Woverflow Woverride-init-side-effects Woverwrite-recursive Wpmf-conversions Wpointer-compare Wpointer-to-int-cast Wpragmas Wprio-ctor-dtor Wproperty-assign-default Wprotocol Wpsabi Wreturn-local-addr Wscalar-storage-order Wshadow-ivar Wshift-count-negative Wshift-count-overflow Wsizeof-array-argument Wstringop-overread Wsubobject-linkage Wswitch-bool Wswitch-outside-range Wswitch-unreachable Wsync-nand Wterminate Wtsan Wunderflow Wunicode Wunused-result Wvarargs Wvexing-parse Wvirtual-move-assign Wxor-used-as-pow Of course, e.g. the -Wanalyzer* warnings are doing something only if -fanalyzer, or say -Wtsan if -fsanitize=thread etc. Jakub