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

            Bug ID: 87884
           Summary: ubsan causes wrong -Wformat-overflow warning
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stsp at users dot sourceforge.net
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Created attachment 44959
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44959&action=edit
test case

Hello.

Attached is the reduced test-case.
It gives:
---
gcc -c -Wall -fsanitize=undefined -O2 mangle.c -I.
mangle.c: In function 'name_convert':
mangle.c:57:3: warning: null destination pointer [-Wformat-overflow=]
   sprintf(s,"%s","test");
---

Which is wrong.
Plus, I am not sure if "-Wformat-overflow=" is a
correct switch for this type of warning.

Reply via email to