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

Phil Stracchino <[email protected]>
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Organization Babylon Communications
Message-ID <[email protected]>
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)



Also, the last line of src/filed/suspend.h does not have a newline,
and building 11.0.x in the Solaris Developer Studio requires that
CFLAGS/CPPFLAGS include -features=zla to allow declaring zero-length arrays.

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



-- 
  Phil Stracchino
  Babylon Communications
  [email protected]
  [email protected]
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958
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.