[all-commits] [llvm/llvm-project] dafc31: [Sema] Emit a -Wformat warning for printf("%s", (v...

Erik Pilkington via All-commits all-commits at lists.llvm.org
Fri Jul 10 12:10:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dafc3106d2069b806a10e072306a2196f1cda585
      https://github.com/llvm/llvm-project/commit/dafc3106d2069b806a10e072306a2196f1cda585
  Author: Erik Pilkington <erik.pilkington at gmail.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M clang/lib/AST/FormatString.cpp
    M clang/test/Sema/format-strings.c

  Log Message:
  -----------
  [Sema] Emit a -Wformat warning for printf("%s", (void*)p)

Its dangerous to assume that the opaque pointer points to a null-terminated
string, and this has an easy fix (casting to char*).

rdar://62432331




More information about the All-commits mailing list