When I test libpng release candidates I mainly test on Gentoo using GCC,
however libpng has to compile on a very large variety of platforms with a
very large variety of compilers.
For this reason libpng is written in strict ANSI C with compiler specific
extensions to enable potentially useful post-ANSI features, such as
'restrict', and specific compilers, including g++ (a C++ compiler.)
To make sure changes don't mess up compilation on systems I don't have
access to, particularly SUN OS (because that is Glenn's primary test
system) I use as extreme a set as I can of GCC compiler warnings and I
treat all warnings as errors.
I also test on as wide a variety of compilers as I can and with a
reasonable set of configuration options on one compiler (the latest GCC
that I have) - a total of 129 builds on my primary development system,
somewhat less on other systems.
It's not reasonable to expect anyone who is not attempting implement major
changes to libpng (as I am) to do this, however compiling with a recent
version of GCC (4.6, 4.7 or 4.8) and an extensive set of warnings *should*
This is what I recommend:
CFLAGS="-pedantic -ansi -Wall -Wextra" <src-dir>/configure --enable-werror
This assumes a hosted environment, I use Gentoo so that's fine. If I were
cross-compiling I could not run "make check" and I would have to build each
of the tests, currently pngtest, pngvalid, pngstest and pngunknown, copy
them to a target system and run the appropriate tests (see the 'tests'
directory in the source.) In practice I can get a long way down the road
just by running 'pngvalid' until it works (no arguments.)
John Bowler <john.cunningham.bowler@...>
+1 (541) 450-9885
PO BOX 3151
KERBY OR 97531-3151