Menu

#228 HAVE_FEENABLEEXCEPT vs PNG_NO_FLOATING_ARITHMETIC

libpng_code
closed-fixed
None
5
2014-10-23
2014-09-17
zootus
No

I'm (cross-)compiling for a handheld (GPH WIZ) and it doesn't have a FPU, so i need do disable that:
configure CPPFLAGS="-I/opt/cc/open2x/include -DPNG_NO_FLOATING_ARITHMETIC"
I get the following error:

contrib/libtests/pngvalid.c: In function 'main':
contrib/libtests/pngvalid.c:10058: error: 'FE_DIVBYZERO' undeclared (first use in this function)
[...]

The toolchain's header files don't define those macros in fenc.h as the device doesn't have a FPU.

In the mentioned file (contrib/libtests/pngvalid.c) i see:

ifdef HAVE_FEENABLEEXCEPT [...]

so i commented that out MANUALLY in config.h as configure doesn't let me disable it.
After that it's compiling successfully.

a) Shouldn't that be disabled anyway if PNG_NO_FLOATING_ARITHMETIC is defined...?

(I'm not sure if that makes sense...)

b) OR it should be possible to disable FEENABLEEXCEPT with configure at first (i guess thats a feature request then)

Discussion

  • Glenn Randers-Pehrson

    Please try libpng-1.6.14beta03 which is currently available at the head of the libpng16 branch of the libpng GIT repository and as tar distributions in the usual places.

     

    Last edit: Glenn Randers-Pehrson 2014-09-19
  • Glenn Randers-Pehrson

    • assigned_to: Glenn Randers-Pehrson
     
  • Glenn Randers-Pehrson

    • status: open --> open-accepted
     
  • zootus

    zootus - 2014-09-20

    Yep, it's compiling now, thx :-)

     
  • Glenn Randers-Pehrson

    In libpng-1.6.14beta03 we have defined FE_DIVBYZERO, etc., if they have not already been defined in the included fenv.h. We did not disable floating point arithmetic in pngvalid.c, even if the user has defined PNG_NO_FLOATING_ARITHMETIC_SUPPORTED (libpng itself would not use floating arithmetic under this circumstance, but pngvalid will, if the platform provides it). See recent discussion (Sept 2014) on the png-mng-implement mailing list.

     
  • Glenn Randers-Pehrson

    Fixed in libpng-1.6.14

     
  • Glenn Randers-Pehrson

    • status: open-accepted --> closed-fixed
     

Log in to post a comment.