[sane-devel] problem with sane-backends-1.0.28 and gnu c++ 4.9.0

r. a. schmied uwppp at flash.net
Thu Sep 26 22:50:48 BST 2019


platform: Solaris 10 10/09 s10s_u8wos_08a SPARC
compiler: g++ (GCC) 4.9.0
scanner: canoscan lide200 (genesys gl847)
usblib: 0.1.7 (shipped with solaris)

notes: sane-backends 1.0.27 and sane-backends-master-e13b80fa built
       and work so issue is with new c++ genesys implementation or
       in other words my antiquated system and tools

i have tried -std=c++11, -std=c++14, -std=gnu++11 and -std=gnu++14 without
any change so either my c++ math headers are inadequate or i need additional
pow overloading declarations or ???.

i have also tried -D__EXTENSIONS__ with no change either.

these 3 errors seem to be the only ones being encountered at compile
time, but linkedit and runtime may reveal others ...
  39:genesys.cc:761:61: error: call of overloaded 'pow(float, double)' is ambiguous
  57:genesys.cc:1308:35: error: call of overloaded 'pow(int, uint8_t&)' is ambiguous
  236:genesys_low.cc:157:48: error: call of overloaded 'pow(int, int&)' is ambiguous

one of many actual g++ command lines tried:
   /opt/csw/bin/g++ \
      -std=gnu++11 \
      -DHAVE_CONFIG_H \
      -D_REENTRANT \
      -DPATH_SANE_CONFIG_DIR=/opt/csw/etc/sane.d \
      -DPATH_SANE_DATA_DIR=/opt/csw/share \
      -DPATH_SANE_LOCK_DIR=/opt/csw/var/lock/sane \
      -DV_MAJOR=1 -DV_MINOR=0 \
      -DLIBDIR="\"/opt/csw/lib/sane\"" \
      -DBACKEND_NAME=genesys \
      -Wall -Wextra -pedantic \
      -MT libgenesys_la-genesys.lo -MD -MP -MF .deps/libgenesys_la-genesys.Tpo \
      -I. -I../include/sane \
      -I../include -I/usr/sfw/include \
      -c -o libgenesys_la-genesys.lo \
      `test -f 'genesys.cc' || echo './'`genesys.cc ; \


solutions other than get a more modern computer?


ras



truncated output from gmake
.
.
.
/usr/bin/bash ../libtool --silent  --tag=CXX   --mode=compile /opt/csw/bin/g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../include/sane  -D_REENTRANT -DPATH_SANE_CONFIG_DIR=/opt/csw/etc/sane.d 	  -DPATH_SANE_DATA_DIR=/opt/csw/share 	  -DPATH_SANE_LOCK_DIR=/opt/csw/var/lock/sane 	  -DV_MAJOR=1 -DV_MINOR=0 -I. -I. -I../include -I../include -I/usr/sfw/include -DLIBDIR="\"/opt/csw/lib/sane\"" -DBACKEND_NAME=genesys  -Wall -Wextra -pedantic  -MT libgenesys_la-genesys.lo -MD -MP -MF .deps/libgenesys_la-genesys.Tpo -c -o libgenesys_la-genesys.lo `test -f 'genesys.cc' || echo './'`genesys.cc
In file included from genesys.h:54:0,
                 from genesys.cc:63:
genesys_low.h:556:44: warning: missing initializer for member 'std::array<short unsigned int, 3u>::_M_elems' [-Wmissing-field-initializers]
     std::array<uint16_t, 3> offset_addr = {};
                                            ^
genesys_low.h:557:42: warning: missing initializer for member 'std::array<short unsigned int, 3u>::_M_elems' [-Wmissing-field-initializers]
     std::array<uint16_t, 3> gain_addr = {};
                                          ^
genesys_low.h:581:36: warning: missing initializer for member 'std::array<unsigned char, 3u>::_M_elems' [-Wmissing-field-initializers]
     std::array<uint8_t, 3> reg2 = {};
                                    ^
In file included from genesys.cc:63:0:
genesys.h:242:31: warning: missing initializer for member 'SANE_Parameters::format' [-Wmissing-field-initializers]
     SANE_Parameters params = {};
                               ^
genesys.h:242:31: warning: missing initializer for member 'SANE_Parameters::last_frame' [-Wmissing-field-initializers]
genesys.h:242:31: warning: missing initializer for member 'SANE_Parameters::bytes_per_line' [-Wmissing-field-initializers]
genesys.h:242:31: warning: missing initializer for member 'SANE_Parameters::pixels_per_line' [-Wmissing-field-initializers]
genesys.h:242:31: warning: missing initializer for member 'SANE_Parameters::lines' [-Wmissing-field-initializers]
genesys.h:242:31: warning: missing initializer for member 'SANE_Parameters::depth' [-Wmissing-field-initializers]
genesys.cc: In function 'void sanei_genesys_create_gamma_table(std::vector<short unsigned int>&, int, float, float, float)':
genesys.cc:761:61: error: call of overloaded 'pow(float, double)' is ambiguous
       value = gamma_max * pow ((float) i / size, 1.0 / gamma);
                                                             ^
genesys.cc:761:61: note: candidates are:
In file included from /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/math.h:26:0,
                 from genesys_low.h:62,
                 from genesys.h:54,
                 from genesys.cc:63:
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/iso/math_iso.h:204:21: note: long double std::pow(long double, long double)
  inline long double pow(long double __X, long double __Y) { return
                     ^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/iso/math_iso.h:171:15: note: float std::pow(float, float)
  inline float pow(float __X, float __Y) { return __powf(__X, __Y); }
               ^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/iso/math_iso.h:72:15: note: double std::pow(double, double)
 extern double pow __P((double, double));
               ^
genesys.cc: In function 'void sanei_genesys_calculate_zmode(uint32_t, uint32_t, uint16_t, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t*, uint32_t*)':
genesys.cc:1308:35: error: call of overloaded 'pow(int, uint8_t&)' is ambiguous
   exposure_factor = pow (2, tgtime); /* todo: originally, this is always 2^0 ! */
                                   ^
genesys.cc:1308:35: note: candidates are:
In file included from /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/math.h:26:0,
                 from genesys_low.h:62,
                 from genesys.h:54,
                 from genesys.cc:63:
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/iso/math_iso.h:204:21: note: long double std::pow(long double, long double)
  inline long double pow(long double __X, long double __Y) { return
                     ^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/iso/math_iso.h:171:15: note: float std::pow(float, float)
  inline float pow(float __X, float __Y) { return __powf(__X, __Y); }
               ^
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.0/include-fixed/iso/math_iso.h:72:15: note: double std::pow(double, double)
 extern double pow __P((double, double));
               ^
Makefile:5665: recipe for target 'libgenesys_la-genesys.lo' failed
gmake[2]: *** [libgenesys_la-genesys.lo] Error 1
.
.
.




More information about the sane-devel mailing list