[libcxx-commits] [PATCH] D112927: [libc++] Enable -Wformat-nonliteral when building libc++

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 16 09:09:08 PST 2021


ldionne added a comment.

In D112927#3130882 <https://reviews.llvm.org/D112927#3130882>, @uabelho wrote:

> In D112927#3123920 <https://reviews.llvm.org/D112927#3123920>, @uabelho wrote:
>
>> Hi,
>>
>> I see a whole bunch of warnings like this with this patch:
>>
>>   /repo/uabelho/llvm-dev2/llvm/build-all-builtins/runtimes/runtimes-i386-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_i386/include/c++/v1/__bsd_locale_fallbacks.h:116:37: warning: format string is not a string literal [-Wformat-nonliteral]
>>       int __res = vsnprintf(__s, __n, __format, __va);
>>                                       ^~~~~~~~
>>   /repo/uabelho/llvm-dev2/llvm/build-all-builtins/runtimes/runtimes-i386-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_i386/include/c++/v1/__bsd_locale_fallbacks.h:126:32: warning: format string is not a string literal [-Wformat-nonliteral]
>>       int __res = vasprintf(__s, __format, __va);
>>                                  ^~~~~~~~
>>   /repo/uabelho/llvm-dev2/llvm/build-all-builtins/runtimes/runtimes-i386-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_i386/include/c++/v1/__bsd_locale_fallbacks.h:136:30: warning: format string is not a string literal [-Wformat-nonliteral]
>>       int __res = vsscanf(__s, __format, __va);
>>                                ^~~~~~~~
>>   3 warnings generated.
>>
>> Both with clang 8 and gcc 9.3
>
> I put up
> https://reviews.llvm.org/D113876
> to silence the warnings

Yup, I'm seeing them too on the build bots. I missed them cause I was only building on Darwin, and that header isn't used on Darwin. Also since those are just warnings they are not failing the build, so CI passed. Looking at your patch now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112927/new/

https://reviews.llvm.org/D112927



More information about the libcxx-commits mailing list