[LLVMbugs] [Bug 22701] New: bogus "format string is not a string literal" warnings

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 25 12:46:33 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22701

            Bug ID: 22701
           Summary: bogus "format string is not a string literal" warnings
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: howarth.mailing.lists at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The gdb developers believe that clang is emitting bogus warnings for
-Wformat-nonliteral. For example...

# clang-3.6  -O2 -g -Wno-unused-value   -I. -I. -I./common -I./config
-DLOCALEDIR="\"/sw/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode
-I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include
-I../libdecnumber -I./../libdecnumber  -I./gnulib/import -Ibuild-gnulib/import 
 -DTUI=1   -I/sw/include  -I/sw/include/guile/2.0 -I/sw/include -D_THREAD_SAFE
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused
-Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
-Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body
-Wmissing-prototypes -Wout-of-line-declaration -Wold-style-definition
-Wformat-nonliteral  -c -o darwin-nat.o -MT darwin-nat.o -MMD -MP -MF
.deps/darwin-nat.Tpo darwin-nat.c --save-temps
darwin-nat.c:184:23: warning: format string is not a string literal
[-Wformat-nonliteral]
  vprintf_unfiltered (fmt, ap);
                      ^~~
1 warning generated.

which can be reproduced with the attached preprocessed source file.

# clang-3.6 -Wformat-nonliteral -c darwin-nat.i
darwin-nat.c:184:23: warning: format string is not a string literal
[-Wformat-nonliteral]
  vprintf_unfiltered (fmt, ap);
                      ^~~
1 warning generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150225/c6724879/attachment.html>


More information about the llvm-bugs mailing list