Bug 137509

Summary: <png.h> fails to compile when <setjmp.h> preceeds it
Product: [Fedora] Fedora Reporter: Kristian Spangsege <ks>
Component: libpngAssignee: Matthias Clasen <mclasen>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-03 14:45:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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)

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.