title: UnsafeMutablePointer to expected argument type UnsafeMutablePointer<_> in Swift 3
body: <p>In the <code>main.swift</code> file, we have a call to our receipt checking system (generated by <a href="http://receigen.etiemble.com/guides-swift.html" rel="nofollow noreferrer">Receigen</a>). In Swift 2, <code>main.swift</code> read:</p>
  
  <pre><code>startup(Process.argc, UnsafeMutablePointer&lt;UnsafePointer&lt;Int8&gt;&gt;(Process.unsafeArgv))
  </code></pre>
  
  <p>After upgrading to Swift 3, I've got as far as:</p>
  
  <pre><code>startup(CommandLine.argc, UnsafeMutablePointer&lt;UnsafePointer&lt;Int8&gt;&gt;(CommandLine.unsafeArgv))
  </code></pre>
  
  <p>which shows the error:</p>
  
  <blockquote>
    <p>Cannot convert value of type
    <code>UnsafeMutablePointer&lt;UnsafeMutablePointer&lt;Int8&gt;?&gt;</code> (aka
    <code>UnsafeMutablePointer&lt;Optional&lt;UnsafeMutablePointer&lt;Int8&gt;&gt;&gt;</code>) to
    expected argument type <code>UnsafeMutablePointer&lt;_&gt;</code></p>
  </blockquote>
  
  <p>Update: Using the <a href="https://stackoverflow.com/a/39089634/341994">linked question</a> so that it reads:</p>
  
  <pre><code>startup(CommandLine.argc, UnsafeMutableRawPointer(CommandLine.unsafeArgv)
      .bindMemory(
          to: UnsafeMutablePointer&lt;Int8&gt;.self,
          capacity: Int(CommandLine.argc)))
  </code></pre>
  
  <p>Produces:</p>
  
  <blockquote>
    <p>Cannot convert value of type <code>UnsafeMutablePointer&lt;Int8&gt;.Type</code> to
    expected argument type <code>UnsafePointer&lt;Int8&gt;?.Type</code> (aka
    <code>Optional&lt;UnsafePointer&lt;Int8&gt;&gt;.Type</code>)</p>
  </blockquote>
  
  <p>Where the compiler is referring to the <code>to:UnsafeMutablePointer</code>. </p>
  
  <p>The header for startup looks like: </p>
  
  <pre><code>int startup(int argc, const char * argv[]);
  </code></pre>
  
  <p>How can I successfully pass the variables to startup in <code>main.swift</code>?</p>