[Poppler-bugs] [Bug 64680] New: pollution of globale namespace with internal classes

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 16 10:48:17 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=64680

          Priority: medium
            Bug ID: 64680
          Assignee: poppler-bugs at lists.freedesktop.org
           Summary: pollution of globale namespace with internal classes
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: duelli at melosgmbh.de
          Hardware: All
            Status: NEW
           Version: unspecified
         Component: general
           Product: poppler

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130516/6c0e067e/attachment.html>


More information about the Poppler-bugs mailing list