On Mon, 2017-02-06 at 23:20 +0100, Sandro Mani wrote:
> I'll narrow this down as time allows and file a GCC bug as soon as I 
> have a reduced test case (provided the narrowing down confirms my 
> miscompilation theory).

        Hi,
I tried to reproduce this with gcc 7.0.1, but still no luck. It doesn't
matter whether I compile PoDoFo as a static library (the default) or as
a shared library, neither whether I use Boost or Lua or some other
optional dependencies on or off (my podofo_config.h currently shows
that I have all the development libraries installed and available).

I use the attached code, which is the same as yours, it only avoids a
memory leak and unused variable, thus neither gcc nor valgrind claim
any issue. The file contain my steps (note the missing `make install`,
the code is run out of the build tree) at the top of it.

Maybe I do something wrong?

        Bye,
        zyx
-- 
http://www.litePDF.cz                                 i...@litepdf.cz
/* Configure in /home/zyx/podofo-0.9.5/build/
      $ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/tmp/podofo -DCMAKE_BUILD_TYPE=Debug -DWANT_BOOST=ON -DPODOFO_BUILD_SHARED=ON ..
   Build:
      $ make
   Compile and run the test:
      $ g++ -g -O0 delayedload.cpp -o delayedload -L/home/zyx/podofo-0.9.5/build/src -rdynamic -lpodofo -lfontconfig -lz -lcrypto -ljpeg -lpthread -lfreetype -lpng -lz -lcrypto -ljpeg -lpthread -lfreetype -lpng -lidn -Wl,-rpath,/home/zyx/podofo-0.9.5/build/src -I/home/zyx/podofo-0.9.5/build -I/home/zyx/podofo-0.9.5 -I/home/zyx/podofo-0.9.5/src -I/usr/include/freetype2    -std=c++98 -Wall -Woverloaded-virtual -Wswitch-enum -Wcast-qual -Wwrite-strings -Wredundant-decls -Wreorder -W -fvisibility=hidden -DPODOFO_HAVE_GCC_SYMBOL_VISIBILITY -ltiff && ./delayedload
*/

#include <stdio.h>
#include "podofo.h"

using namespace PoDoFo;

int main(void)
{
	PdfError::EnableLogging(true);

	try {
		PdfStreamedDocument *document = new PdfStreamedDocument("/tmp/delayedload.pdf");
		PdfImage pdfImage(document);
		PdfDictionary &dictionary = pdfImage.GetObject()->GetDictionary();
		printf ("All fine; has XXX:%d\n", dictionary.HasKey(PdfName("XXX")));
		delete document;
	} catch (const PdfError &error) {
		fprintf (stderr, "Failed with error:\n");
		error.PrintErrorMsg();
	}

	return 0;
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to