[PATCH] D41017: Fix test/msan/iconv.cc on NetBSD

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 08:59:14 PST 2017


krytarowski created this revision.
krytarowski added a project: Sanitizers.

NetBSD still uses the old POSIX iconv(3) signature with the 2nd const argument.

Sponsored by <The NetBSD Foundation>


Repository:
  rL LLVM

https://reviews.llvm.org/D41017

Files:
  test/msan/iconv.cc


Index: test/msan/iconv.cc
===================================================================
--- test/msan/iconv.cc
+++ test/msan/iconv.cc
@@ -15,8 +15,8 @@
   char inbuf_[100];
   strcpy(inbuf_, "sample text");
   char outbuf_[100];
-#if defined(__FreeBSD__)
-  // FreeBSD's iconv() expects the 2nd argument be of type 'const char**'.
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+  // Due to old POSIX mistake some OSes expect 2nd argument of iconv() to be of type 'const char**'.
   const char *inbuf = inbuf_;
 #else
   char *inbuf = inbuf_;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41017.126164.patch
Type: text/x-patch
Size: 551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171208/2482613b/attachment.bin>


More information about the llvm-commits mailing list