From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by sourceware.org (Postfix) with ESMTPS id 196643858C55 for ; Mon, 26 Feb 2024 15:56:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 196643858C55 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 196643858C55 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=145.40.73.55 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708963003; cv=none; b=Zi53gSpev+dElKA+0yjqs5R73Mqlnno5APin+JF+6+Nyfd9fACx2KQm9fapT8N/EaW1Op7EFZSmc+ZXdYCNhvEjHU1jx/xs4mQdwnXMzD+JWKyKT/peWBMnZOikF4MB45fxSi8afp1jr7TR6NaSL6w8benqOle7YVAZuKyL3pB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708963003; c=relaxed/simple; bh=pPKXMqhQPz1qDovLnLViixkU4jC/8cjMzLGkjXkXvEU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=cVExG82gfHQjVGDlc2hE2WW8gxvF8AOAHERxzPpxw8b4Lfv6e9OHketcid1yaE+UXdpCCnXtbuYojiDVEQ/uiLu4m+ENeLerhR7ZnvyyHSzuo9DcHsL4qbfxrErzLmBHzeAmfpg/KivJaylhDIW08KrvZ7ERpK4CLDS69dJ2+fQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 085C0CE1801; Mon, 26 Feb 2024 15:56:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67754C433C7; Mon, 26 Feb 2024 15:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708962994; bh=pPKXMqhQPz1qDovLnLViixkU4jC/8cjMzLGkjXkXvEU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FJmTXdeUIxI8AY9CHilPAJNMwG+6xOEhdu4geuBWAgLi12rBB/xIITWPjC8d6PbtH vMr6gUSKpI0VdWFoPAXFIOOzT9g2it1GpZQUopQo3rlnW28EazBovgtOR29kwjeN8R pUcVYJgxIQIzFxawwKfxF8KQf53dbGw3XAMPQi0zMvuwiBu8k4W3+b0sqE0wTmayHs yH/lUI9LBbj9cnPXdDAMzUUVHEYE6S6TvIV+mwos5466xBdaCzweyQQcoN+60llvJC 4QD4nMNPbHKRjjCCLs6W62VcWnLwChRXewzLtZB817mGisePVIeOTR6dGbTkF2VlR1 EYqx6TSfED1Yg== Date: Mon, 26 Feb 2024 16:56:24 +0100 From: Alejandro Colomar To: Joseph Myers Cc: Mike Stump , GCC Patches Subject: Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization Message-ID: References: <20240206104529.8347-1-alx@kernel.org> <10AB5F4B-A27B-4798-9029-626A8B69DA6D@comcast.net> <60699168-584-3155-a463-4811af5d33fa@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TUvkelY6bvCcqbXC" Content-Disposition: inline In-Reply-To: <60699168-584-3155-a463-4811af5d33fa@redhat.com> X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --TUvkelY6bvCcqbXC Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Mon, 26 Feb 2024 16:56:24 +0100 From: Alejandro Colomar To: Joseph Myers Cc: Mike Stump , GCC Patches Subject: Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization Hi Joseph, On Mon, Feb 26, 2024 at 03:24:32PM +0000, Joseph Myers wrote: > On Sun, 25 Feb 2024, Mike Stump wrote: >=20 > > On Feb 6, 2024, at 2:45 AM, Alejandro Colomar wrote: > > >=20 > > > Warn about the following: > > >=20 > > > char s[3] =3D "foo"; > >=20 > > No ObjC specific impact here, so no need for ObjC review. > >=20 > > As a member of the peanut gallery, I like the patch. > >=20 > > Joseph, this is been submitted 5 times over the past year. Any thought= s? >=20 > The idea seems reasonable, but the patch needs documentation for the new= =20 > option in invoke.texi. Thanks! Will do. I don't see an obvious order in that file. Where would you put the option? Do you want me to sort(1) it first, and then insert the new option in alphabetic order? $ man gcc 2>/dev/null | grep -e '^ \{0,3\}[^ ]' -e '^ \{4,7\}-' | sed -n '/= ^ \{1,3\}Options to Request or Suppress Warnings/,/^ \{1,3\}[^ ]/p' Options to Request or Suppress Warnings -fsyntax-only -fmax-errors=3Dn -w Inhibit all warning messages. -Werror -Werror=3D -Wfatal-errors -Wno- options with old compilers, but if something goes wrong, the com= piler warns that an unrecognized option is present. -Wpedantic -pedantic -pedantic-errors -Wall -Wextra -Wabi (C, Objective=E2=80=90C, C++ and Objective-C++ only) -Wno-changes-meaning (C++ and Objective-C++ only) -Wchar-subscripts -Wno-coverage-mismatch -Wno-coverage-invalid-line-number -Wno-cpp (C, Objective=E2=80=90C, C++, Objective-C++ and Fortran only) -Wdouble-promotion (C, C++, Objective=E2=80=90C and Objective-C++ only) -Wduplicate-decl-specifier (C and Objective=E2=80=90C only) -Wformat -Wformat=3Dn -Wno-format-contains-nul -Wno-format-extra-args -Wformat-overflow -Wformat-overflow=3Dlevel -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-truncation -Wformat-truncation=3Dlevel -Wformat-y2k -Wnonnull -Wnonnull-compare -Wnull-dereference -Winfinite-recursion -Winit-self (C, C++, Objective=E2=80=90C and Objective-C++ only) -Wno-implicit-int (C and Objective=E2=80=90C only) -Wno-implicit-function-declaration (C and Objective=E2=80=90C only) -Wimplicit (C and Objective=E2=80=90C only) -Wimplicit-fallthrough -Wimplicit-fallthrough=3Dn -Wno-if-not-aligned (C, C++, Objective=E2=80=90C and Objective-C++ onl= y) -Wignored-qualifiers (C and C++ only) -Wno-ignored-attributes (C and C++ only) -Wmain -Wmisleading-indentation (C and C++ only) -Wmissing-attributes -Wmissing-braces -Wmissing-include-dirs (C, C++, Objective=E2=80=90C, Objective-C++ and= Fortran only) -Wno-missing-profile -Wmismatched-dealloc -Wmultistatement-macros -Wparentheses -Wno-self-move (C++ and Objective-C++ only) -Wsequence-point -Wno-return-local-addr -Wreturn-type -Wno-shift-count-negative -Wno-shift-count-overflow -Wshift-negative-value -Wno-shift-overflow -Wshift-overflow=3Dn -Wswitch -Wswitch-default -Wswitch-enum -Wno-switch-bool -Wno-switch-outside-range -Wno-switch-unreachable -Wsync-nand (C and C++ only) -Wtrivial-auto-var-init -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs (C, Objective=E2=80=90C, C++ and Objective-C++= only) -Wunused-parameter -Wno-unused-result -Wunused-variable -Wunused-const-variable -Wunused-const-variable=3Dn -Wunused-value -Wunused -Wuninitialized -Wno-invalid-memory-model -Wmaybe-uninitialized -Wunknown-pragmas -Wno-pragmas -Wno-prio-ctor-dtor -Wstrict-aliasing -Wstrict-aliasing=3Dn -Wstrict-overflow -Wstrict-overflow=3Dn -Wstring-compare -Wno-stringop-overflow -Wstringop-overflow -Wstringop-overflow=3Dtype -Wno-stringop-overread -Wno-stringop-truncation -Wstrict-flex-arrays -Wsuggest-attribute=3D[pure|const|noreturn|format|cold|malloc] -Walloc-zero -Walloc-size-larger-than=3Dbyte=E2=80=90size -Wno-alloc-size-larger-than -Walloca -Walloca-larger-than=3Dbyte=E2=80=90size -Wno-alloca-larger-than -Warith-conversion -Warray-bounds -Warray-bounds=3Dn -Warray-compare -Warray-parameter -Warray-parameter=3Dn -Wattribute-alias=3Dn -Wno-attribute-alias -Wbidi-chars=3D[none|unpaired|any|ucn] -Wbool-compare -Wbool-operation -Wduplicated-branches -Wduplicated-cond -Wframe-address -Wno-discarded-qualifiers (C and Objective=E2=80=90C only) -Wno-discarded-array-qualifiers (C and Objective=E2=80=90C only) -Wno-incompatible-pointer-types (C and Objective=E2=80=90C only) -Wno-int-conversion (C and Objective=E2=80=90C only) -Wzero-length-bounds -Wno-div-by-zero -Wsystem-headers -Wtautological-compare -Wtrampolines -Wfloat-equal -Wtraditional (C and Objective=E2=80=90C only) -Wtraditional-conversion (C and Objective=E2=80=90C only) -Wdeclaration-after-statement (C and Objective=E2=80=90C only) -Wshadow -Wno-shadow-ivar (Objective=E2=80=90C only) -Wshadow=3Dglobal -Wshadow=3Dlocal -Wshadow=3Dcompatible-local -Wlarger-than=3Dbyte=E2=80=90size -Wno-larger-than -Wframe-larger-than=3Dbyte=E2=80=90size -Wno-frame-larger-than -Wfree-nonheap-object -Wstack-usage=3Dbyte=E2=80=90size -Wno-stack-usage -Wunsafe-loop-optimizations -Wno-pedantic-ms-format (MinGW targets only) -Wpointer-arith -Wno-pointer-compare -Wtsan -Wtype-limits -Wabsolute-value (C and Objective=E2=80=90C only) -Wcomment -Wcomments -Wtrigraphs -Wundef -Wexpansion-to-defined -Wunused-macros -Wno-endif-labels -Wbad-function-cast (C and Objective=E2=80=90C only) -Wc90-c99-compat (C and Objective=E2=80=90C only) -Wc99-c11-compat (C and Objective=E2=80=90C only) -Wc11-c2x-compat (C and Objective=E2=80=90C only) -Wc++-compat (C and Objective=E2=80=90C only) -Wc++11-compat (C++ and Objective-C++ only) -Wc++14-compat (C++ and Objective-C++ only) -Wc++17-compat (C++ and Objective-C++ only) -Wc++20-compat (C++ and Objective-C++ only) -Wno-c++11-extensions (C++ and Objective-C++ only) -Wno-c++14-extensions (C++ and Objective-C++ only) -Wno-c++17-extensions (C++ and Objective-C++ only) -Wno-c++20-extensions (C++ and Objective-C++ only) -Wno-c++23-extensions (C++ and Objective-C++ only) -Wcast-qual -Wcast-align -Wcast-align=3Dstrict -Wcast-function-type -Wwrite-strings -Wclobbered -Wno-complain-wrong-lang -Wconversion -Wdangling-else -Wdangling-pointer -Wdangling-pointer=3Dn -Wdate-time -Wempty-body -Wno-endif-labels -Wenum-compare -Wenum-conversion -Wenum-int-mismatch (C and Objective=E2=80=90C only) -Wjump-misses-init (C, Objective=E2=80=90C only) -Wsign-compare -Wsign-conversion -Wfloat-conversion -Wno-scalar-storage-order -Wsizeof-array-div -Wsizeof-pointer-div -Wsizeof-pointer-memaccess -Wno-sizeof-array-argument -Wmemset-elt-size -Wmemset-transposed-args -Waddress -Wno-address-of-packed-member -Wlogical-op -Wlogical-not-parentheses -Waggregate-return -Wno-aggressive-loop-optimizations -Wno-attributes -Wno-builtin-declaration-mismatch -Wno-builtin-macro-redefined -Wstrict-prototypes (C and Objective=E2=80=90C only) -Wold-style-declaration (C and Objective=E2=80=90C only) -Wold-style-definition (C and Objective=E2=80=90C only) -Wmissing-parameter-type (C and Objective=E2=80=90C only) -Wmissing-prototypes (C and Objective=E2=80=90C only) -Wmissing-declarations -Wmissing-field-initializers -Wno-missing-requires -Wno-missing-template-keyword -Wno-multichar -Wnormalized=3D[none|id|nfc|nfkc] -Wno-attribute-warning -Wno-deprecated -Wno-deprecated-declarations -Wno-overflow -Wno-odr -Wopenacc-parallelism -Wopenmp-simd -Woverride-init (C and Objective=E2=80=90C only) -Wno-override-init-side-effects (C and Objective=E2=80=90C only) -Wpacked -Wnopacked-bitfield-compat -Wpacked-not-aligned (C, C++, Objective=E2=80=90C and Objective-C++ on= ly) -Wpadded -Wredundant-decls -Wrestrict -Wnested-externs (C and Objective=E2=80=90C only) -Winline -Winterference-size -Wint-in-bool-context -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast (C and Objective=E2=80=90C only) -Winvalid-pch -Winvalid-utf8 -Wno-unicode -Wlong-long -Wvariadic-macros -Wno-varargs -Wvector-operation-performance -Wvla -Wvla-larger-than=3Dbyte=E2=80=90size -Wno-vla-larger-than -Wvla-parameter -Wvolatile-register-var -Wxor-used-as-pow (C, C++, Objective=E2=80=90C and Objective-C++ only) -Wdisabled-optimization -Wpointer-sign (C and Objective=E2=80=90C only) -Wstack-protector -Woverlength-strings -Wunsuffixed-float-constants (C and Objective=E2=80=90C only) -Wno-lto-type-mismatch -Wno-designated-init (C and Objective=E2=80=90C only) Options That Control Static Analysis Have a lovely day! Alex --=20 Looking for a remote C programming job at the moment. --TUvkelY6bvCcqbXC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmXctKgACgkQnowa+77/ 2zLQJQ/8Cy0I5qNh/BnWTXxiH/AltbGuajzB+Os2kHHzuqhku2VLaRidEIa0VIDE RApu96w660x4sRNxpTu6w00xswK3JbtIt+oYJHA+GTTRvkvwKaZwNPIub6Uo/JIO TVDT6Or4h2VhtPUED/TMfCri9OSKOrZXZ5lGwjZBkcZC/Ecyzv4X/K93wuYCCN/X eJWcUXBYCrebA2JL7ehvqnlsmEXTMZ/T1o3H9YrkzCr/QU2lKqK+Wk8VHjb1XuvC nnjAC0SJ4fgA/yllCZzZ4d/TYnyvup1z5/xptyHRc+aEvQaS3OvgGT32uYqgpPyk 47KW5J4n5sqBJMUoxX6c0sf1AabasTagaw3fu20iQZ4XM4zjYFuaTdzcVrbCGeSA DzG90xEFo1/QWv486S8HELrKmS/KwRImFUgdk/kM1mkUM5XV2vuYEcYswOPURb3h 5LA2KWZcPmVSTutFzTjU5NKawo9SO6N23nWXQI6vT8RMN4mIWdtNreyHfoRJ10FU HJEbHA4//4UQ9geuIBXCWy75wH7s/Lk7IcqTnb0zQq5loPf2h+eLjQwL2G9yRewT jWXFdPZfHCqSSqkssTQBHVXJZMHze/yMVOW4OG2G1kejXqyF9slVwM8QoWla4hbX m/S2iPg6xM9mti1ERbpdf9ugdy48ifeK6gXL05ZoK+zMd1pmJfc= =RuvQ -----END PGP SIGNATURE----- --TUvkelY6bvCcqbXC--