<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [UBSAN] Call to function (unknown) through pointer to incorrect function type"
   href="https://bugs.llvm.org/show_bug.cgi?id=32692">32692</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[UBSAN] Call to function (unknown) through pointer to incorrect function type
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ernest.galix@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18297" name="attach_18297" title="Source code">attachment 18297</a> <a href="attachment.cgi?id=18297&action=edit" title="Source code">[details]</a></span>
Source code

I have a program that dynamically links against a library.
The program passes a function pointer to that library, to execute.

But the ubsan (Undefined Behavior Sanitizer) specified that the pointer is on
an incorrect function type. And that occurs only 

 - if the callback function has a class as parameter
 - if the callback function has a class as parameter, but only forward declared
 - if I specify the compilation flags: -fvisibility=hidden.

I use clang to compile my project.

The attached code is reduced to a simple test case. Check the comments to see
where we can act to remove some warnings. But these fixes seem obvious.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>