Re: Building v15 on Solaris fails xxhash.h error: '_Static_assert' was not declared in this scope

Andrew Watkins <[email protected]> Wed, 13 May 2026 16:10:44 +0100
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Message-ID <[email protected]>
--===============6760063964146020638==
Content-Type: multipart/alternative;
 boundary="------------H01ht6Dk8kWNqvJRL1wOtMIB"
Content-Language: en-GB

--------------H01ht6Dk8kWNqvJRL1wOtMIB
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

Full output of compile below.

I see the problem the libtool is picking this line 1812 in xxhash.h:

     #  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)    
/* C11 */
     define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
*_Static_assert*((c),m); } while(0)

Where it should be "I am gussing" line 1814:

     #  elif defined(__cplusplus) && (__cplusplus >= 201103L)            
/* C++11 */
     #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
*static_assert*((c),m); } while(0)

The question of how to fix it. Information I have:

# gcc  -x c++ /dev/null -E -dD |grep STDC_VERSION
#define __STDC_VERSION__ 201112L

Full output:

$ cd src/lib
$ /home/andrew/src/bacula-15.0.3/libtool --tag=CXX --mode=compile 
/usr/gcc/14/bin/g++   -c  -x c++ -fno-strict-aliasing -fno-exceptions 
-fno-rtti  -I. -I..  -g -O2 -W all -m64 -x c++ -fno-strict-aliasing 
-fno-exceptions -fno-rtti xxhash.c
libtool: compile:  /usr/gcc/14/bin/g++ -c -x c++ -fno-strict-aliasing 
-fno-exceptions -fno-rtti -I. -I.. -g -O2 -Wall -m64 -x c++ 
-fno-strict-aliasing -fno-exceptions -fno-rtti xxhash.c  -fPIC -DPIC -o 
.libs/xxhash.o
In file included from xxhash.c:43:
*xxhash.h: In function 'void XXH32_canonicalFromHash(XXH32_canonical_t*, 
XXH32_hash_t)':*
*xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?*
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:2535:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  2535 |  XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == 
sizeof(XXH32_hash_t));
       |     ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'void XXH64_canonicalFromHash(XXH64_canonical_t*, 
XXH64_hash_t)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:2961:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  2961 |  XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == 
sizeof(XXH64_hash_t));
       |     ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'void XXH3_initCustomSecret_sse2(void*, xxh_u64)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:4383:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  4383 |  XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0);
       |     ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'void XXH3_initCustomSecret_scalar(void*, xxh_u64)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:4752:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  4752 |  XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0);
       |     ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'XXH64_hash_t XXH3_hashLong_64b_internal(const 
void*, std::size_t, const void*, std::size_t, XXH3_f_accumulate_512, 
XXH3_f_scrambleAcc)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:4976:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  4976 |     XXH_STATIC_ASSERT(sizeof(acc) == 64);
       |     ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'XXH_errorcode XXH3_update(XXH3_state_t*, const 
xxh_u8*, std::size_t, XXH3_f_accumulate_512, XXH3_f_scrambleAcc)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:5342:9: note: in expansion of macro 'XXH_STATIC_ASSERT'
  5342 |  XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN == 
0);   /* clean multiple */
       |         ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'XXH128_hash_t XXH3_hashLong_128b_internal(const 
void*, std::size_t, const xxh_u8*, std::size_t, XXH3_f_accumulate_512, 
XXH3_f_scrambleAcc)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:5768:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  5768 |     XXH_STATIC_ASSERT(sizeof(acc) == 64);
       |     ^~~~~~~~~~~~~~~~~
xxhash.h: In function 'void 
XXH128_canonicalFromHash(XXH128_canonical_t*, XXH128_hash_t)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this 
scope; did you mean 'static_assert'?
  1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0)
       |                 ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro 
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  1818 | #  define XXH_STATIC_ASSERT(c) 
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:6011:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  6011 |  XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) == 
sizeof(XXH128_hash_t));
       |     ^~~~~~~~~~~~~~~~~

Thanks,
Andrew

On 5/11/2026 5:56 PM, Martin Simmons wrote:
> The config.out looks OK to me.
>
> In particular in:
>
>     C Compiler:                gcc 13.4.0
>     C++ Compiler:              /usr/gcc/13/bin/g++ 13.4.0
>     Compiler flags:             -g -O2 -Wall -m64 -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti
>
> the -x c++ option is supposed to force the compiler to compile the file as
> C++, so __STDC_VERSION__ should not be defined.  That works for gcc/g++ in
> general.
>
> I think you have to investigate the exact command line used to compile
> xxhash.c by doing:
>
> cd src/lib
> make NO_ECHO=
>
> That should make it print the commands so you can check it is using the
> expected compiler and flags.  I assume this will give the same error.
>
> If you see it running libtool --silent then try running the same libtool
> command without --silent to see how libtool is invoking the compiler.
>
> __Martin
>
>
>>>>>> On Fri, 1 May 2026 19:57:20 +0100, Andrew Watkins said:
>> Hi,
>>
>> I can see what it is doing but why?
>>
>>   From xxhash.h
>>
>> /* note: use after variable declarations */
>> #ifndef XXH_STATIC_ASSERT
>> #  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)    /*
>> C11 */          <<<<<
>> #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do {
>> _Static_assert((c),m); } while(0) <<<<< This being picked in error!!!
>> #  elif defined(__cplusplus) && (__cplusplus >= 201103L)            /*
>> C++11 */
>> #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do {
>> static_assert((c),m); } while(0)  <<<<< Is this correct for Solaris?
>> #  else
>> #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { struct xxh_sa {
>> char x[(c) ? 1 : -1]; }; } while(0)
>> #  endif
>> #  define XXH_STATIC_ASSERT(c) XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
>> #endif
>>
>> Attached is config.out
>>
>> Thanks,
>> Andrew
>>
>>
>> On 5/1/2026 5:27 PM, Martin Simmons wrote:
>>>>>>>> On Fri, 1 May 2026 12:14:09 +0100, Andrew Watkins said:
>>>> Hello,
>>>>
>>>> I was looking at moving to Bacula 15.0.3 on our servers, but it does not
>>>> build on Solaris 11.4
>>>>
>>>> Version 13.0.4 builds on Solaris.
>>>>
>>>> I get this in xxhash (doesn't look like this is in v13)
>>>>
>>>> In file included from xxhash.c:43:
>>>> xxhash.h: In function 'void XXH32_canonicalFromHash(XXH32_canonical_t*,
>>>> XXH32_hash_t)':
>>>> xxhash.h:1812:54: error: '_Static_assert' was not declared in this
>>>> scope; did you mean 'static_assert'?
>>>>     1812 | #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do {
>>>> _Static_assert((c),m); } while(0)
>>>>          | ^~~~~~~~~~~~~~
>>>> xxhash.h:1818:32: note: in expansion of macro
>>>> 'XXH_STATIC_ASSERT_WITH_MESSAGE'
>>>>     1818 | #  define XXH_STATIC_ASSERT(c)
>>>> XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
>>>>          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> xxhash.h:2535:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
>>>>     2535 |     XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) ==
>>>> sizeof(XXH32_hash_t));
>>>>          |     ^~~~~~~~~~~~~~~~~
>>> It looks like there is some confusion about C v.s. C++.
>>>
>>> What C++ compiler & version are you using?
>>>
>>> Can you show us the contents of config.out (generated by configure)?
>>>
>>> __Martin
>> -- 
>> *****************************************************
>> *****    Support [email protected]    *****
>> *****************************************************
>> * Andrew Watkins                                    *
>> * Birkbeck, University of London                    *
>> * Computing and Mathematical Sciences               *
>> *https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fnotallmicrosoft.blogspot.com&c=E,1,wm3CK_7eqnUXaHAjzfsRLCBJb57d1tQSxCgVdR7fBUl0EOcqDDZiY3osSJYGGLO5uWR0p9F8P2bQQgDQz0UIDEvkV1Cn0256T-dDtOFVLo4l&typo=1               *
>> *****************************************************
>>
-- 
*****************************************************
*****    Support Request [email protected]    *****
*****************************************************
* Andrew Watkins                                    *
* Birkbeck, University of London                    *
* Computing and Mathematical Sciences               *
*http://notallmicrosoft.blogspot.com               *
*****************************************************

--------------H01ht6Dk8kWNqvJRL1wOtMIB
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html><html data-lt-installed="true"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p>Hi,</p>
    <p>Full output of compile below.&nbsp;</p>
    <p>I see the problem the libtool is picking this line 1812 in
      xxhash.h:</p>
    <font face="monospace">&nbsp; &nbsp; #&nbsp; if defined(__STDC_VERSION__)
      &amp;&amp; (__STDC_VERSION__ &gt;= 201112L)&nbsp; &nbsp; /* C11 */&nbsp; &nbsp;&nbsp;</font><br>
    <font face="monospace">&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { <b>_Static_assert</b>((c),m);
      } while(0)</font>
    <p>Where it should be &quot;I am gussing&quot; line 1814:</p>
    <font face="monospace">&nbsp; &nbsp; #&nbsp; elif defined(__cplusplus) &amp;&amp;
      (__cplusplus &gt;= 201103L)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* C++11 */<br>
      &nbsp; &nbsp; #&nbsp; &nbsp; define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { <b>static_assert</b>((c),m);
      } while(0)</font>
    <p>The question of how to fix it. Information I have:</p>
    <p># gcc&nbsp; -x c++ /dev/null -E -dD |grep STDC_VERSION<br>
      #define __STDC_VERSION__ 201112L</p>
    <p><font face="monospace">Full output:</font></p>
    <font face="monospace">$ cd src/lib</font><br>
    <font face="monospace">$ /home/andrew/src/bacula-15.0.3/libtool
      --tag=CXX --mode=compile /usr/gcc/14/bin/g++&nbsp; &nbsp;-c&nbsp; -x c++
      -fno-strict-aliasing -fno-exceptions -fno-rtti&nbsp; -I. -I..&nbsp; -g -O2
      -W all -m64 -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti&nbsp;
      xxhash.c</font><br>
    <font face="monospace">libtool: compile:&nbsp; /usr/gcc/14/bin/g++ -c -x
      c++ -fno-strict-aliasing -fno-exceptions -fno-rtti -I. -I.. -g -O2
      -Wall -m64 -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti
      xxhash.c&nbsp; -fPIC -DPIC -o .libs/xxhash.o</font><br>
    <font face="monospace">In file included from xxhash.c:43:</font><br>
    <font face="monospace"><b>xxhash.h: In function 'void
        XXH32_canonicalFromHash(XXH32_canonical_t*, XXH32_hash_t)':</b></font><br>
    <font face="monospace"><b>xxhash.h:1812:54: error: '_Static_assert'
        was not declared in this scope; did you mean 'static_assert'?</b></font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:2535:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;2535 |&nbsp; &nbsp;
      &nbsp;XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) ==
      sizeof(XXH32_hash_t));</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'void
      XXH64_canonicalFromHash(XXH64_canonical_t*, XXH64_hash_t)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:2961:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;2961 |&nbsp; &nbsp;
      &nbsp;XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) ==
      sizeof(XXH64_hash_t));</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'void
      XXH3_initCustomSecret_sse2(void*, xxh_u64)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:4383:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;4383 |&nbsp; &nbsp;
      &nbsp;XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE &amp; 15) == 0);</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'void
      XXH3_initCustomSecret_scalar(void*, xxh_u64)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:4752:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;4752 |&nbsp; &nbsp;
      &nbsp;XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE &amp; 15) == 0);</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'XXH64_hash_t
      XXH3_hashLong_64b_internal(const void*, std::size_t, const void*,
      std::size_t, XXH3_f_accumulate_512, XXH3_f_scrambleAcc)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:4976:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;4976 |&nbsp; &nbsp; &nbsp;XXH_STATIC_ASSERT(sizeof(acc) ==
      64);</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'XXH_errorcode
      XXH3_update(XXH3_state_t*, const xxh_u8*, std::size_t,
      XXH3_f_accumulate_512, XXH3_f_scrambleAcc)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:5342:9: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;5342 |&nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp;XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN ==
      0);&nbsp; &nbsp;/* clean multiple */</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'XXH128_hash_t
      XXH3_hashLong_128b_internal(const void*, std::size_t, const
      xxh_u8*, std::size_t, XXH3_f_accumulate_512, XXH3_f_scrambleAcc)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:5768:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;5768 |&nbsp; &nbsp; &nbsp;XXH_STATIC_ASSERT(sizeof(acc) ==
      64);</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h: In function 'void
      XXH128_canonicalFromHash(XXH128_canonical_t*, XXH128_hash_t)':</font><br>
    <font face="monospace">xxhash.h:1812:54: error: '_Static_assert' was
      not declared in this scope; did you mean 'static_assert'?</font><br>
    <font face="monospace">&nbsp;1812 | #&nbsp; &nbsp; define
      XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); }
      while(0)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:1818:32: note: in expansion of macro
      'XXH_STATIC_ASSERT_WITH_MESSAGE'</font><br>
    <font face="monospace">&nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
      XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font><br>
    <font face="monospace">xxhash.h:6011:5: note: in expansion of macro
      'XXH_STATIC_ASSERT'</font><br>
    <font face="monospace">&nbsp;6011 |&nbsp; &nbsp;
      &nbsp;XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) ==
      sizeof(XXH128_hash_t));</font><br>
    <font face="monospace">&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~</font>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Thanks,</div>
    <div class="moz-cite-prefix">Andrew</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 5/11/2026 5:56 PM, Martin Simmons
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:[email protected]">
      <pre wrap="" class="moz-quote-pre">The config.out looks OK to me.

In particular in:

   C Compiler:                gcc 13.4.0
   C++ Compiler:              /usr/gcc/13/bin/g++ 13.4.0
   Compiler flags:             -g -O2 -Wall -m64 -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti

the -x c++ option is supposed to force the compiler to compile the file as
C++, so __STDC_VERSION__ should not be defined.  That works for gcc/g++ in
general.

I think you have to investigate the exact command line used to compile
xxhash.c by doing:

cd src/lib
make NO_ECHO=

That should make it print the commands so you can check it is using the
expected compiler and flags.  I assume this will give the same error.

If you see it running libtool --silent then try running the same libtool
command without --silent to see how libtool is invoking the compiler.

__Martin


</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <pre wrap="" class="moz-quote-pre">On Fri, 1 May 2026 19:57:20 +0100, Andrew Watkins said:
</pre>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
        <pre wrap="" class="moz-quote-pre">
Hi,

I can see what it is doing but why?

 From xxhash.h

/* note: use after variable declarations */
#ifndef XXH_STATIC_ASSERT
#&nbsp; if defined(__STDC_VERSION__) &amp;&amp; (__STDC_VERSION__ &gt;= 201112L)&nbsp; &nbsp; /* 
C11 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt;&lt;&lt;&lt;
#&nbsp; &nbsp; define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
_Static_assert((c),m); } while(0) &lt;&lt;&lt;&lt;&lt; This being picked in error!!!
#&nbsp; elif defined(__cplusplus) &amp;&amp; (__cplusplus &gt;= 201103L)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* 
C++11 */
#&nbsp; &nbsp; define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { 
static_assert((c),m); } while(0)&nbsp; &lt;&lt;&lt;&lt;&lt; Is this correct for Solaris?
#&nbsp; else
#&nbsp; &nbsp; define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { struct xxh_sa { 
char x[(c) ? 1 : -1]; }; } while(0)
#&nbsp; endif
#&nbsp; define XXH_STATIC_ASSERT(c) XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
#endif

Attached is config.out

Thanks,
Andrew


On 5/1/2026 5:27 PM, Martin Simmons wrote:
</pre>
        <blockquote type="cite">
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <blockquote type="cite">
                    <pre wrap="" class="moz-quote-pre">On Fri, 1 May 2026 12:14:09 +0100, Andrew Watkins said:
</pre>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
            <pre wrap="" class="moz-quote-pre">Hello,

I was looking at moving to Bacula 15.0.3 on our servers, but it does not
build on Solaris 11.4

Version 13.0.4 builds on Solaris.

I get this in xxhash (doesn't look like this is in v13)

In file included from xxhash.c:43:
xxhash.h: In function 'void XXH32_canonicalFromHash(XXH32_canonical_t*,
XXH32_hash_t)':
xxhash.h:1812:54: error: '_Static_assert' was not declared in this
scope; did you mean 'static_assert'?
  &nbsp;1812 | #&nbsp; &nbsp; define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do {
_Static_assert((c),m); } while(0)
  &nbsp; &nbsp; &nbsp; | ^~~~~~~~~~~~~~
xxhash.h:1818:32: note: in expansion of macro
'XXH_STATIC_ASSERT_WITH_MESSAGE'
  &nbsp;1818 | #&nbsp; define XXH_STATIC_ASSERT(c)
XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
  &nbsp; &nbsp; &nbsp; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xxhash.h:2535:5: note: in expansion of macro 'XXH_STATIC_ASSERT'
  &nbsp;2535 |&nbsp; &nbsp; &nbsp;XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) ==
sizeof(XXH32_hash_t));
  &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~~
</pre>
          </blockquote>
          <pre wrap="" class="moz-quote-pre">It looks like there is some confusion about C v.s. C++.

What C++ compiler &amp; version are you using?

Can you show us the contents of config.out (generated by configure)?

__Martin
</pre>
        </blockquote>
        <pre wrap="" class="moz-quote-pre">
-- 
*****************************************************
*****    Support Request <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>    *****
*****************************************************
* Andrew Watkins                                    *
* Birkbeck, University of London                    *
* Computing and Mathematical Sciences               *
*<a class="moz-txt-link-freetext" href="https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fnotallmicrosoft.blogspot.com&amp;c=E,1,wm3CK_7eqnUXaHAjzfsRLCBJb57d1tQSxCgVdR7fBUl0EOcqDDZiY3osSJYGGLO5uWR0p9F8P2bQQgDQz0UIDEvkV1Cn0256T-dDtOFVLo4l&amp;typo=1">https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fnotallmicrosoft.blogspot.com&amp;c=E,1,wm3CK_7eqnUXaHAjzfsRLCBJb57d1tQSxCgVdR7fBUl0EOcqDDZiY3osSJYGGLO5uWR0p9F8P2bQQgDQz0UIDEvkV1Cn0256T-dDtOFVLo4l&amp;typo=1</a>               *
*****************************************************

</pre>
      </blockquote>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
*****************************************************
*****    Support Request to <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>    *****
*****************************************************
* Andrew Watkins                                    *
* Birkbeck, University of London                    *
* Computing and Mathematical Sciences               *
* <a class="moz-txt-link-freetext" href="http://notallmicrosoft.blogspot.com">http://notallmicrosoft.blogspot.com</a>               *
*****************************************************</pre>
  </body>
  <lt-container></lt-container>
</html>

--------------H01ht6Dk8kWNqvJRL1wOtMIB--


--===============6760063964146020638==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============6760063964146020638==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

--===============6760063964146020638==--