<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 - Documentation UBSan not clear"
   href="https://bugs.llvm.org/show_bug.cgi?id=42789">42789</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Documentation UBSan not clear
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jvapen@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The documentation at
<a href="https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html">https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html</a> is interesting,
however, when one starts to use it seems to be lacking some relevant
information that might be obvious if you already know how things work. Possibly
the implementation doesn't support certain behavior, which one could implicitly
assume as a reasonable behavior.


Windowing applications
----------------------
As I'm on windows, with a windowing application, I can't see any of the
standard output that gets created. If I run with a console application, I
nicely see the output in the terminal.
=> Are windowing applications not supported? If they are supported, where does
the output go to? Can it be written in a file?

Trap on UB
----------
The page itself mentions -fno-sanitize-recover=... which is really nice,
however, it doesn't link to
<a href="https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation">https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation</a> for
where the actual details are about this.
I first had to find this second page before realizing that UBSan only reports
and doesn't trap when it encounters an issue.

Custom Trap
-----------
I've also looked into -ftrap-function, which ain't even mentioned on the page.
However, it was not immediately clear that this function needs to be a
C-linkage void(void) function. (Most documentation about this was found at
<a href="https://clang.llvm.org/docs/UsersManual.html#cmdoption-ftrap-function">https://clang.llvm.org/docs/UsersManual.html#cmdoption-ftrap-function</a>)

Nor was is obvious from the description of -fsanitize-trap that this trap
function doesn't get a 'const char *' with the actual reason.
(It does make sense after one has the complete puzzle) It mentions you don't
need the runtime. Which I assumed was for the extra callstack support.</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>