[PATCH] D66420: Be explicit about Windows coff name trailing character policy

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 11:28:06 PDT 2019


rnk added a comment.

Why does this suppress the warning? Just the templatization?



================
Comment at: llvm/lib/Object/WindowsResource.cpp:520-521
+// it's okay to *not* copy the trailing zero.
+template <size_t DestSize>
+static void coffnamecpy(char (&Dest)[DestSize], StringRef Src) {
+  static_assert(DestSize <= COFF::NameSize, "Dest is large enough");
----------------
Can we drop the template parameter and make `Dest` `char (&Dest)[COFF::NameSize]`? Then all we need is the assert for `Src.size() <= COFF::NameSize`.


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

https://reviews.llvm.org/D66420





More information about the llvm-commits mailing list