title: error: call of overloaded function ambiguous
body: <p>I am trying to compile <a href="https://github.com/msharov/ustl" rel="nofollow noreferrer">ustl</a> C++ library with MinGW GCC compiler on Windows 10.</p>
  <p>The 41st line in the C++ header below was able to solve thanks to <a href="https://stackoverflow.com/questions/4672152/call-of-overloaded-function-is-ambiguous/4673320">this answer</a>, but there is a problem at line 43. How should I solve it?</p>
  <p><a href="https://github.com/msharov/ustl/blob/master/fstream.h#L41" rel="nofollow noreferrer">https://github.com/msharov/ustl/blob/master/fstream.h#L41</a></p>
  <pre><code>    // int          ioctl (const char* rname, int request, long argument = 0);   // orig
      int         ioctl (const char* rname, int request, long argument = 0u);
      inline int      ioctl (const char* rname, int request, int argument)    { return fstream::ioctl (rname, request, long(argument)); }
      inline int      ioctl (const char* rname, int request, void* argument)  { return fstream::ioctl (rname, request, intptr_t(argument)); }
  </code></pre>
  <p>MinGW GCC compiler (10.3.0 (Rev5, Built by MSYS2 project)) error message:</p>
  <pre class="lang-none prettyprint-override"><code>fstream.h:43:132: error: call of overloaded 'ioctl(const char*&amp;, int&amp;, uintptr_t)' is ambiguous
      43 |     inline int  ioctl (const char* rname, int request, void* argument) { return fstream::ioctl (rname, request, uintptr_t(argument)); }
  </code></pre>
  <p>--
  Edit: Thanks for the hint.
  With <a href="https://stackoverflow.com/questions/1640423/error-cast-from-void-to-int-loses-precision">another answer</a>, below code works for me:</p>
  <p><a href="https://github.com/msharov/ustl/blob/master/fstream.h#L43" rel="nofollow noreferrer">https://github.com/msharov/ustl/blob/master/fstream.h#L43</a></p>
  <pre><code> // ... intptr_t(argument));  // orig
   *((long*)(argument))); 
  </code></pre>