<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - pollution of globale namespace with internal classes"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=64680">64680</a>
          </td>
        </tr>

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

        <tr>
          <th>Summary</th>
          <td>pollution of globale namespace with internal classes
          </td>
        </tr>

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

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>duelli@melosgmbh.de
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

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

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

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

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In fofi/FoFiIdentifier.cc there are several internal classes MemReader,
FileReader etc.
These are in the global namespace.

Incidentally, in our code there is a class FileReader, too.
It also has a constructor FileReaader(FILE*). Guess which code gets executed in
FoFiIdentifier.cc ... the wrong one.
(Yes, FileReader is a rather dangerous name, and no, my FileReader is in the
global namespace as well....)
This leads to a crash when opening a pdf containing fonts that need to be
looked up.

Trivial solution: wrap the internal classes with an anonymous namespace.
Or with namespace poppler. As the class is internal to this file, this won't
cause problems.

Another good idea might be to introduce symbol (in)visiblity...

Best regards
and thank you for a really helpful library.</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>