Bug#522477: [png-mng-implement] Bug#522477: inkscape: FTBFS: pngconf.h:328: error: expected constructor, destructor, or type conversion before '.' token

2009-04-14 Thread John Bowler
From: Wolfram Quester [mailto:wo...@sigxcpu.org] 
OK, thanks for the link. But the crazy thing is that inkscape
includes setjmp.h in the code leading to the compiler error
only via png.h. 

You need to look for the #define of _SETJMP_H.  Greg's method doesn't work
for that unfortunately, but some header file *other* than setjmp.h is
defining it.  IMO that's a big bug in itself, though I've seen similar
things done in code attempting to fake out system header files and
substitute a different implementation.

First check that you really have a valid png.h:

${CC} -c -o foo.o /usr/include/png.h

If this fails your installation has been hacked; reinstall libpng.  If it
still fails then the gcc standard pre-include is itself #include'ing
setjmp.h.  I think someone suggested that on a bug around 2000 - I saw
something to that effect on a recent web search.

Then take the file that fails and temporarily move the #include png.h to
the top of the file - make it the first #include.  Rebuild.  If that fails
you have a local png.h and *it* has been hacked - get a released version.
If it still fails your build script sets the gcc pre-include to #include
setjmp.h, fix it.

If it still works move #include png.h down towards its previous location
in the file.  (Use a binary chop.)  This will isolate the #include that is
the top level culprit.  Suppose this is foo.h, then you should be able to
repro the problem with a simple file of the form:

#include foo.h
#include png.h

You will probably need to get the gcc -I directives to match those in the
build, but maybe not - just try a simple gcc -c first.

Now it gets more difficult unless it is immediately obvious where foo.h
defines _SETJMP_H.  If you can hack on foo.h then you can actually insert
#include png.h into the middle and repeat the search in there.  If not you
may be able to make a local foo.h and repro the problem in the same way, but
beware the semantics of #include bar.h within foo.h - it actually means
'include the bar.h from the directory containing foo.h'.  If you can't repro
the problem with a local foo.h it is because you have changed 'the directory
containing foo.h'.

John Bowler jbow...@acm.org




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#522477: [png-mng-implement] Bug#522477: inkscape: FTBFS: pngconf.h:328: error: expected constructor, destructor, or type conversion before '.' token

2009-04-14 Thread Kurt Roeckx
On Mon, Apr 13, 2009 at 06:17:52PM +0200, Wolfram Quester wrote:
 
 OK, thanks for the link. But the crazy thing is that inkscape includes 
 setjmp.h
 in the code leading to the compiler error only via png.h. It does not include
 setjmp.h directly.
 So I'm still tempted to call this a bug in libpng. Furthermore, since we 
 don't include
 setjmp.h I don't see a way for th recommended workaround, namely including 
 png.h before
 setjmp.h. But I have to look deeper into the code for a fix.

/usr/include/freetype2/freetype/config/ftstdlib.h has an
#include setjmp.h


Kurt




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#522477: [png-mng-implement] Bug#522477: inkscape: FTBFS: pngconf.h:328: error: expected constructor, destructor, or type conversion before '.' token

2009-04-13 Thread Wolfram Quester
On Sat, Apr 11, 2009 at 07:00:55PM -0400, Tom Lane wrote:
 Wolfram Quester wo...@sigxcpu.org writes:
  Kurt Roeckx submitted the bug against inkscape cited below.
 
  In file included from /usr/include/libpng12/png.h:474,
  from sp-image.cpp:44:
  /usr/include/libpng12/pngconf.h:328: error: expected constructor, 
  destructor, or type conversion before '.' token
  /usr/include/libpng12/pngconf.h:329: error: '__dont__' does not name a type
  make[3]: *** [sp-image.o] Error 1
 
 If you didn't figure it out already: it looks to me like this is exactly
 the same setjmp issue being discussed in the other current thread.
 
 http://sourceforge.net/mailarchive/forum.php?thread_name=1806.1239115719%40sss.pgh.pa.usforum_name=png-mng-implement

OK, thanks for the link. But the crazy thing is that inkscape includes setjmp.h
in the code leading to the compiler error only via png.h. It does not include
setjmp.h directly.
So I'm still tempted to call this a bug in libpng. Furthermore, since we don't 
include
setjmp.h I don't see a way for th recommended workaround, namely including 
png.h before
setjmp.h. But I have to look deeper into the code for a fix.

Thanks,

Wolfi

 
 As far as I can see the consensus is that nothing much can be done about
 this in libpng 1.2.x.  We could possibly fix it in 1.4 by making
 incompatible changes in the libpng API.
 
   regards, tom lane


signature.asc
Description: Digital signature


Bug#522477: [png-mng-implement] Bug#522477: inkscape: FTBFS: pngconf.h:328: error: expected constructor, destructor, or type conversion before '.' token

2009-04-11 Thread Tom Lane
Wolfram Quester wo...@sigxcpu.org writes:
 Kurt Roeckx submitted the bug against inkscape cited below.

 In file included from /usr/include/libpng12/png.h:474,
 from sp-image.cpp:44:
 /usr/include/libpng12/pngconf.h:328: error: expected constructor, 
 destructor, or type conversion before '.' token
 /usr/include/libpng12/pngconf.h:329: error: '__dont__' does not name a type
 make[3]: *** [sp-image.o] Error 1

If you didn't figure it out already: it looks to me like this is exactly
the same setjmp issue being discussed in the other current thread.

http://sourceforge.net/mailarchive/forum.php?thread_name=1806.1239115719%40sss.pgh.pa.usforum_name=png-mng-implement

As far as I can see the consensus is that nothing much can be done about
this in libpng 1.2.x.  We could possibly fix it in 1.4 by making
incompatible changes in the libpng API.

regards, tom lane



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org