public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/104042] New: Four memcpy/memset analyzer failures on darwin
@ 2022-01-15 14:03 fxcoudert at gcc dot gnu.org
  2022-01-15 14:05 ` [Bug analyzer/104042] " fxcoudert at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2022-01-15 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104042
           Summary: Four memcpy/memset analyzer failures on darwin
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

Created attachment 52202
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52202&action=edit
Preprocessed source

Some analyzer testcases fail on darwin
(https://gcc.gnu.org/pipermail/gcc-testresults/2022-January/747918.html) due to
what I believe are false positive.

Those four cases fail for the same reason:

gcc.dg/analyzer/data-model-1.c
gcc.dg/analyzer/pr103526.c
gcc.dg/analyzer/taint-size-1.c
gcc.dg/analyzer/write-to-string-literal-1.c

The failures are related to memcpy and memset, and can be reduced to this:

$ cat write-to-string-literal-1.c 
#include <string.h>

void test_2 (void) {
  memcpy ("abc", "def", 3); /* { dg-warning "write to string literal" } */
}
$ ./bin/gcc -fdiagnostics-plain-output -fanalyzer -Wanalyzer-too-complex
-fanalyzer-call-summaries write-to-string-literal-1.c -c

No warning is emitted, and the test expects a warning. The preprocessed source
for this reduced testcase is attached.


The testcase passes if the memcpy() call is replaced by __builtin_memcpy().

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

end of thread, other threads:[~2024-04-28 14:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 14:03 [Bug analyzer/104042] New: Four memcpy/memset analyzer failures on darwin fxcoudert at gcc dot gnu.org
2022-01-15 14:05 ` [Bug analyzer/104042] " fxcoudert at gcc dot gnu.org
2022-01-15 14:23 ` iains at gcc dot gnu.org
2022-01-15 14:24 ` iains at gcc dot gnu.org
2022-01-15 21:50 ` pinskia at gcc dot gnu.org
2023-08-19 21:29 ` fxcoudert at gcc dot gnu.org
2023-11-03 13:21 ` fxcoudert at gcc dot gnu.org
2024-04-01 13:27 ` cvs-commit at gcc dot gnu.org
2024-04-20 14:46 ` cvs-commit at gcc dot gnu.org
2024-04-28 14:43 ` cvs-commit 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).