On 01/11/2018 20:30, Kern Sibbald wrote:
Hello Gary,

The Bacula project uses GCC, and with it we do not get those errors.  If you are using a different compiler (as it seems you are doing), you are likely to find different "warnings".  Since we only use the gnu compiler, the best way to get rid of these errors is to find a fix for them that works both on your compiler and on gcc and send it to us.

Hahahahaha.

================================================================
$ gcc -v
Thu Nov  1 22:08:44 AEDT 2018
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/local/bin/../libexec/gcc/x86_64-pc-solaris2.11/7.3.0/lto-wrapper
Target: x86_64-pc-solaris2.11
Configured with: ../gcc-7.3.0/configure
Thread model: posix
gcc version 7.3.0 (GCC)

Configured as before but without the CC and CXX variables being set.

==>Entering directory /home/grs/src/bacula/bacula-9.2.1/src
gmake[1]: Entering directory `/home/grs/src/bacula/bacula-9.2.1/src'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `/home/grs/src/bacula/bacula-9.2.1/src'
==>Entering directory /home/grs/src/bacula/bacula-9.2.1/scripts
gmake[1]: Entering directory `/home/grs/src/bacula/bacula-9.2.1/scripts'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `/home/grs/src/bacula/bacula-9.2.1/scripts'
==>Entering directory /home/grs/src/bacula/bacula-9.2.1/src/lib
gmake[1]: Entering directory `/home/grs/src/bacula/bacula-9.2.1/src/lib'
Compiling attr.c
Compiling base64.c
Compiling berrno.c
Compiling bsys.c
Compiling binflate.c
Compiling bget_msg.c
Compiling bnet.c
Compiling bnet_server.c
Compiling bsock.c
Compiling bpipe.c
Compiling bsnprintf.c
bsnprintf.c: In function 'int64_t round(double)':
bsnprintf.c:622:35: error: 'int64_t round(double)' conflicts with a previous declaration
 static int64_t round(LDOUBLE value)
                                   ^
In file included from /opt/local/lib/gcc/x86_64-pc-solaris2.11/7.3.0/include-fixed/math.h:25:0,
                 from /opt/local/include/c++/7.3.0/bits/std_abs.h:40,
                 from /opt/local/include/c++/7.3.0/cstdlib:77,
                 from /opt/local/include/c++/7.3.0/stdlib.h:36,
                 from ../bacula.h:70,
                 from bsnprintf.c:36:
/usr/include/iso/math_c99.h:490:15: note: previous declaration 'double std::round(double)'
 extern double round __P((double));
               ^~~~~
bsnprintf.c: In function 'int32_t fmtfp(char*, int32_t, int32_t, double, int, int, int)':
bsnprintf.c:688:55: error: call of overloaded 'round(double)' is ambiguous
    fracpart = round((pow10(max)) * (ufvalue - intpart));
                                                       ^
bsnprintf.c:622:16: note: candidate: int64_t round(double)
 static int64_t round(LDOUBLE value)
                ^~~~~
In file included from /opt/local/lib/gcc/x86_64-pc-solaris2.11/7.3.0/include-fixed/math.h:25:0,
                 from /opt/local/include/c++/7.3.0/bits/std_abs.h:40,
                 from /opt/local/include/c++/7.3.0/cstdlib:77,
                 from /opt/local/include/c++/7.3.0/stdlib.h:36,
                 from ../bacula.h:70,
                 from bsnprintf.c:36:
/usr/include/iso/math_c99.h:490:15: note: candidate: double std::round(double)
 extern double round __P((double));
               ^~~~~
In file included from /opt/local/lib/gcc/x86_64-pc-solaris2.11/7.3.0/include-fixed/math.h:25:0,
                 from /opt/local/include/c++/7.3.0/bits/std_abs.h:40,
                 from /opt/local/include/c++/7.3.0/cstdlib:77,
                 from /opt/local/include/c++/7.3.0/stdlib.h:36,
                 from ../bacula.h:70,
                 from bsnprintf.c:36:
/usr/include/iso/math_c99.h:777:15: note: candidate: float std::round(float)
  inline float round(float __X) { return __roundf(__X); }
               ^~~~~
/usr/include/iso/math_c99.h:822:21: note: candidate: long double std::round(long double)
  inline long double round(long double __X) { return __roundl(__X); }
                     ^~~~~
gmake[1]: *** [bsnprintf.lo] Error 1
gmake[1]: Leaving directory `/home/grs/src/bacula/bacula-9.2.1/src/lib'


  ====== Error in /home/grs/src/bacula/bacula-9.2.1/src/lib ======


gmake: *** [all] Error 1
================================================================

Then, for completeness, I removed the "-m64" to build a 32-bit version, and the same error occurred.

Do we have to use a particular version of GCC/G++?

Would it not be easier to require code that conforms to standards?

(As libtool is used to hide how things are compiled, I have no great interest in researching the failure.)

        Cheers,
                Gary    B-)


_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to