<html>
    <head>
      <base href="https://bugs.freedesktop.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 - [patch] Allow disabling C assertions with configure --disable-assert"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90796">90796</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[patch] Allow disabling C assertions with configure --disable-assert
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>williambader@hotmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=116191" name="attach_116191" title="patch to configure.ac to configure assert()">attachment 116191</a> <a href="attachment.cgi?id=116191&action=edit" title="patch to configure.ac to configure assert()">[details]</a></span>
patch to configure.ac to configure assert()

Poppler has a number of calls to assert() that are enabled by default.
Some of them could be expensive, for example,
Splash::gouraudTriangleShadedFill() in splash.cc has two assert() tests inside
an inner loop, and one of the tests does a real number calculation for each
pixel:
  assert(fabs(colorinterp - (scanColorMap[0] * X + scanColorMap[1])) < 1e-10);
  assert(bitmapOff == Y * rowSize + colorComps * X && scanLineOff == Y *
rowSize);

In addition, it would be bad for an application that used poppler to abort
(possibly losing work) just because poppler had an internal inconsistency that
might have corrupted an image but would not have caused a bad memory access.

The attached patch to configure.ac adds a --disable-assert option to configure
that adds -DNDEBUG to CPPFLAGS.  Some headers include <assert.h> before (or
without) including config.h, so I think that it is safer to pass -DNDEBUG on
the command line than to try to trace every include <assert.h> in each header
to verify that every path to include the header has already included config.h.

William</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>