From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14D36386F45A; Wed, 22 Jul 2020 13:22:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14D36386F45A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595424158; bh=j1sGtm59wImKFYmRpWpafhSklfDWdOVIirK/nlox7Gw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iTbJIZAuqTZ05B1PJbkIsj9Ob+7aUkOFWjSIQwxcyTB906NufbtDcMtCJgEdsheq9 lqFGzvGKsMMKJk1frjKHszBeqroDWs5FSK1rPecDlOmODYaLKW05ZhO809GIPsrzJO AQmBI2RBToyNM0ACrxEULlLro1wG6KgtoY/3p01k= From: "david at westcontrol dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61579] -Wwrite-strings does not behave as a warning option Date: Wed, 22 Jul 2020 13:22:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: david at westcontrol dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2020 13:22:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61579 David Brown changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david at westcontrol dot c= om --- Comment #7 from David Brown --- Could "-Wwrite-strings" be split into two options? The warning could remain (and become part of -Wall for C as well as C++) if the compiler can spot and warn about attempts to write to string literals, while keeping these of type "char[len]" as required by C. A new option "-fconst-strings" could be put under "Code Gen Options" which makes C string literals be type "const char[len]" for those that want it, encouraging a slightly safer code style that is not standard C.=