[PATCH 3/3] main: Annotate format string args on new *_utf8 functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 7, 2014 at 11:12 AM, David Woodhouse <dwmw2 at infradead.org> wrote:
> On Sat, 2014-12-06 at 23:01 -0800, Kevin Cernekee wrote:
>> The new charset translation functions need to use caller-supplied format
>> strings; this change corrects the following warnings:
>>
>>       CC       openconnect-main.o
>>     main.c:422:22: warning: format string is not a string literal
>>           [-Wformat-nonliteral]
>>                     return vfprintf(f, fmt, args);
>>                                        ^~~
>>     main.c:424:29: warning: format string is not a string literal
>>           [-Wformat-nonliteral]
>>             ret = vasprintf(&utf8_str, fmt, args);
>>                                        ^~~
>
>
> Hm, I could have sworn we couldn't shut it up because of
> http://llvm.org/bugs/show_bug.cgi?id=18982

My first impulse was to just nuke -Wformat-nonliteral, but then I ran
across this:

http://stackoverflow.com/questions/20167124/vsprintf-and-vsnprintf-wformat-nonliteral-warning-on-clang-5-0

and realized it is OK to pass 0 as the "first-to-check" parameter.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux