Re: format string is not a string literal
Simon Marchi <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CAFXXi0kTXpo++fHcTkWHbAT9sH_pG5ZtgeFf-2RQqZZigzdmdw@mail.gmail.com> |
>> On Feb 25, 2015, at 4:41 PM, Jack Howarth <[email protected]> wrote: >> >> Andrew, >> See the additional comments from the llvm.org clang developers at... >> >> http://llvm.org/bugs/show_bug.cgi?id=22701#c5 > > Then put this warning under a different flag. Anyways clang is broken and gdb should not change due to a broken compiler. > > Thanks, > Andrew I would not say that clang is broken or that the warning is unclear. The flag is -Wformat-nonliteral and the warning message is "format string is not a string literal". I don't know how you can be more clear and direct about the fact that the format string is not a string literal. Looking at the code, we observe that clang is right (the format string is indeed not a string literal). With the proper function attributes, the compiler could do better checks and prevent programming mistakes. Since clang pointed out this low-hanging fruit improvement to gdb's code, why shouldn't we take advantage of it? Anyway, Jack, you are welcome to submit a patch for this if you feel like it and/or file a bug if it is not already done. Simon