Hello,

I am quite surprised that the static function did not take precedence. 
In any case, I have changed the subroutine name to be bround(), and will
push it to the git rep this evening.

Thanks for pointing this out,
Kern

On 3/1/19 8:27 AM, Gary R. Schmidt wrote:
> On 2019-02-06 20:33, Kern Sibbald wrote:
>> Hello,
>>
>> We are pleased to announce the release of Bacula version 9.4.2.  It is
>> already released to Source Forge and bacula.org.  Binaries for selected
>> should be available in the near future.
>>
>> This is a bug fix release to the prior version (9.4.1) that includes a
>> number of bug fixes and patches. Thanks to the community for your
>> participation.  9 bug reports were closed. In addition this version
>> should fix virtually all the build problems found on FreeBSD.
>>
>> We recommend that all users upgrade to this release.
>>
>> Thanks for using Bacula,
>>
>> Kern
>>
>
> After not trying 9.4.1, due to being about to go on hols, and thereby
> ducking a bullet, and having caught up, I thought I would try 9.4.2...
>
> Building on Solaris 11.3 fails using g++ 7.3.0 fails.
>
> ----------------------------------------------------------
> $ g++ -v
> Using built-in specs.
> COLLECT_GCC=g++
> 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)
> $
> $ ./configure \
>     CFLAGS="-g -O -m64" \
>     LDFLAGS="-m64" \
>     --prefix=/opt/bacula \
>     --with-postgresql=/opt/postgres \
>     --enable-smartalloc \
>     --enable-lockmgr \
>     --enable-batch-insert \
>     --with-x \
>     --x-includes=/usr/include/X11 \
>     --with-smtp-host=mail
>
> $ gmake NO_ECHO=
> ==>Entering directory /home/garys/src/bacula/bacula-9.4.2/src
> gmake[1]: Entering directory `/home/garys/src/bacula/bacula-9.4.2/src'
> gmake[1]: Nothing to be done for `all'.
> gmake[1]: Leaving directory `/home/garys/src/bacula/bacula-9.4.2/src'
> ==>Entering directory /home/garys/src/bacula/bacula-9.4.2/scripts
> gmake[1]: Entering directory
> `/home/garys/src/bacula/bacula-9.4.2/scripts'
> gmake[1]: Nothing to be done for `all'.
> gmake[1]: Leaving directory `/home/garys/src/bacula/bacula-9.4.2/scripts'
> ==>Entering directory /home/garys/src/bacula/bacula-9.4.2/src/lib
> gmake[1]: Entering directory
> `/home/garys/src/bacula/bacula-9.4.2/src/lib'
> Compiling attr.c
> /opt/local/bin/g++   -c  -x c++ -fno-strict-aliasing -fno-exceptions
> -fno-rtti  -I. -I..  -g -O -m64 -x c++ -fno-strict-aliasing
> -fno-exceptions -fno-rtti  attr.c
> ...
> Compiling bsnprintf.c
> /opt/local/bin/g++   -c  -x c++ -fno-strict-aliasing -fno-exceptions
> -fno-rtti  -I. -I..  -g -O -m64 -x c++ -fno-strict-aliasing
> -fno-exceptions -fno-rtti  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.o] Error 1
> gmake[1]: Leaving directory `/home/garys/src/bacula/bacula-9.4.2/src/lib'
>
>
>   ====== Error in /home/garys/src/bacula/bacula-9.4.2/src/lib ======
>
>
> gmake: *** [all] Error 1
> $
> ----------------------------------------------------------
> Note that the same error occurs  when building a 32-bit version (i.e.
> without the "-m64" option).
>
> I've tried varying the g++ standard flags, using -std=gnu++11,
> gnu++14, and gnu++1z, just for fun, and unsurprisingly got no change.
>
> Changing "round" to "bacula_round" fixes this problem, as it is a
> static function; on to the next (if there is one).
>
>         Cheers,
>                 Gary    B-)
>
>
> _______________________________________________
> Bacula-devel mailing list
> Bacula-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-devel



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

Reply via email to