> On Feb 25, 2015, at 6:21 PM, Jack Howarth <[email protected]> wrote:
>
> Paul,
> The clang developers disagree...
>
> http://llvm.org/bugs/show_bug.cgi?id=22701#c3
>
> Jack
>
> On Tue, Feb 24, 2015 at 1:09 PM, <[email protected]> wrote:
>>
>>> On Feb 24, 2015, at 12:13 PM, Jack Howarth <[email protected]> wrote:
>>>
>>> Building gdb 7.9 on x86_64-apple-darwin14 produces a number of
>>> warnings from -Wformat-nonliteral...
>>
>> Sounds like it’s time to turn off that warning, since the code is legit.
>>
>> paul
I didn’t say it’s a bug, Andrew did. But I agree with him.
My comment (“the code is legit”) simply meant that GDB uses variable formats for obvious valid reasons (so the format can vary, being user-supplied). Given that it’s intentional, the warning is not wanted.
But that point is really applicable to printf, not vprintf. Andrew’s point is that checking formats for vprintf is not possible because you can’t know the argument list; only in printf do you see the arguments so you can match the types. So the bug is that format checking and complaining for non-literal formats should not be enabled at all for vprintf. That may be a header issue rather than a compiler issue, but either way, it’s not the right thing to do.
paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.