Re: FIXED Re: 11.0.0/11.0.1 badly formed expression on Solaris 11.3 with Solaris Developer Studio 12.6

Radosław Korzeniewski <[email protected]>
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Message-ID <CAF_EmoBEbD8mcFPQ-FAzZ1MrWgkHaT48W8ZDAcYcLWSTmGMNtA@mail.gmail.com>
Hello Phil,

sob., 27 lut 2021 o 23:50 Phil Stracchino <[email protected]> napisał(a):

> On 2/27/21 4:18 PM, Phil Stracchino wrote:
> >
> > make[1]: Entering directory `/netstore/src/bacula-11.0.1/src/lib'
> > Compiling bsockcore.c
> > "bsockcore.c", line 88: Error: Badly formed expression.
> > "bsockcore.c", line 98: Error: Badly formed expression.
> > "bsockcore.c", line 101: Error: Badly formed expression.
> > 3 Error(s) detected.
> > make[1]: *** [bsockcore.lo] Error 1
>
>
> Got a fix.  The problem is that typeof() is not standard C, and Solaris
> compilers do not implement it.  __typeof() is available and can be used
> instead.
>
>
> --- src/lib/serial.h.orig       2021-02-27 17:29:59.288402523 -0500
> +++ src/lib/serial.h    2021-02-27 17:29:19.585632589 -0500
> @@ -77,12 +77,12 @@
>                           expected length s.  */
>  #define ser_check(x, s) ASSERT(ser_length(x) == ((uint32_t)(s)))
>  #define unser_check(x, s) ASSERT(unser_length(x) == ((uint32_t)(s)))
>
>  /*  ser_assign(ptr, len) -- assign current position to ptr and go len
> bytes forward  */
> -#define ser_assign(ptr, len) { ptr = (typeof(ptr))ser_ptr; ser_ptr +=
> (len); }
> -#define unser_assign(ptr, len) { ptr = (typeof(ptr))ser_ptr; ser_ptr +=
> (len); }
> +#define ser_assign(ptr, len) { ptr = (__typeof(ptr))ser_ptr; ser_ptr +=
> (len); }
> +#define unser_assign(ptr, len) { ptr = (__typeof(ptr))ser_ptr; ser_ptr
> += (len); }
>
>  /*                          Serialisation                   */
>
>  /*  8 bit signed integer  */
>  #define ser_int8(x)     *ser_ptr++ = (x)
>
>
Bacula configure script is checking for typeof() and sets HAVE_TYPEOF if
found. I think the proper fix should use:

#ifdef HAVE_TYPEOF
...
#else
...
#endif

This scheme is used in Bacula in a few places already. Could you add this
issue to bugs.bacula.org, please.

Also, the last line of src/filed/suspend.h does not have a newline,
>

Is it a real problem for SDS?


> and building 11.0.x in the Solaris Developer Studio requires that
> CFLAGS/CPPFLAGS include -features=zla to allow declaring zero-length
> arrays.
>

Could you point to the code where you have this, I think it should be fixed
as the new c11 standard forbids zero length arrays explicitly.


> With these, it builds on Solaris 11; with many warnings, but it does
> build, and thus far the warnings have been harmless.
>

The build with a newest clang compiler throws a lot of warnings too which
we systematically resolve. :)

best regards
-- 
Radosław Korzeniewski
[email protected]

_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.