Bug 137509 - <png.h> fails to compile when <setjmp.h> preceeds it
Summary: <png.h> fails to compile when <setjmp.h> preceeds it
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: libpng
Version: 2
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-28 22:49 UTC by Kristian Spangsege
Modified: 2007-11-30 22:10 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2004-11-03 14:45:06 UTC


Attachments (Terms of Use)

Description Kristian Spangsege 2004-10-28 22:49:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
Compiling the following file (2 lines) fails:

#include <setjmp.h>
#include <png.h>


As a C-file (not C++) it gives the following error for me:

In file included from /usr/include/png.h:349,
                 from t.c:2:
/usr/include/pngconf.h:263: error: syntax error before '.' token


If the order of the two includes is reversed, then compilation
succeeds without any errors!!


Same result for both versions of gcc:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --disable-libunwind-exceptions --with-system-zlib
--enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)


Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.0/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-languages=c,c++,objc,java,f77
--host=i386-redhat-linux
Thread model: posix
gcc version 3.4.0 (Red Hat Linux 3.4.0-1)


Regards,
Kristian Spangsege (ks@instadia.net)

Version-Release number of selected component (if applicable):
1.2.5-8 and 1.2.7-1

How reproducible:
Always

Steps to Reproduce:
1. Paste the two include statemens from the description into a file
called t.c
2. Run: gcc t.c


Actual Results:  Compilation fails with the following output:

In file included from /usr/include/png.h:349,
                 from t.c:2:
/usr/include/pngconf.h:263: error: syntax error before '.' token


Expected Results:  Successfull compilation. Then an error from the
linker because main cannot be found.

Additional info:

Comment 1 Matthias Clasen 2004-11-03 14:45:06 UTC
This is a restriction explicitly coded in the png headers. You can't
include png.h after setjmp.h. If you want to change that, you will
have to convince the upstream authors.


Note You need to log in before you can comment on or make changes to this bug.