public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/95007] New: RFE: -fanalyzer should complain about writes to string literals
@ 2020-05-08 14:09 dmalcolm at gcc dot gnu.org
  2020-05-11  4:42 ` [Bug analyzer/95007] " egallager at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-05-08 14:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95007

            Bug ID: 95007
           Summary: RFE: -fanalyzer should complain about writes to string
                    literals
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

(Motivated by PR analyzer/95000, which has a false-positive path to a write to
a string literal)

Consider:

void test (void)
{
  char *s = "foo";
  s[0] = 'g';
}

-fanalyzer should complain about the write to s[0], but currently doesn't

See e.g.
https://wiki.sei.cmu.edu/confluence/display/c/STR30-C.+Do+not+attempt+to+modify+string+literals

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-12 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 14:09 [Bug analyzer/95007] New: RFE: -fanalyzer should complain about writes to string literals dmalcolm at gcc dot gnu.org
2020-05-11  4:42 ` [Bug analyzer/95007] " egallager at gcc dot gnu.org
2020-05-11 16:25 ` dmalcolm at gcc dot gnu.org
2020-10-12 16:06 ` cvs-commit at gcc dot gnu.org
2020-10-12 16:07 ` dmalcolm at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).