================ @@ -0,0 +1,23 @@ +.. title:: clang-tidy - bugprone-undefined-sprintf-overlap + +bugprone-undefined-sprintf-overlap +================================== + +Warns if any arguments to the sprintf family of functions overlap with the +first argument. + +.. code-block:: c++ + + char buf[20] = {"hi"}; + sprintf(buf, "%s%d", buf, 0); + +C99 and POSIX.1-2001 states that if copying were to take place between objects +that overlap, the result is undefined. + +Options +------- + +.. option:: SprintfRegex + + A regex specifying the sprintf family of functions to match on. By default, + this is "(::std)?::sn?printf". ---------------- EugeneZelenko wrote:
```suggestion this is `(::std)?::sn?printf`. ``` https://github.com/llvm/llvm-project/pull/114244 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits