This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: format string is not a string literal


> On Feb 25, 2015, at 6:21 PM, Jack Howarth <howarth.mailing.lists@gmail.com> 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,  <Paul_Koning@dell.com> wrote:
>> 
>>> On Feb 24, 2015, at 12:13 PM, Jack Howarth <howarth.mailing.lists@gmail.com> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]