Error in building

With the last version of SWI (pull from github) I get a compile error from the ssl package:

/home/dazzolin/swipl-devel/packages/ssl/crypto4pl.c: In function ‘recover_rsa’:
/home/dazzolin/swipl-devel/packages/ssl/crypto4pl.c:872:26: error: ‘rsa’ undeclared (first use in this function)
   if ( get_bn_arg(1, t, &rsa->n) &&

cmake version 3.14. The same happens with cmake version 3.21

Thanks. Depends in SSL version rather than cmake. This should be a problem on old OpenSSL (<1.1) and LibreSSL. Pushed a fix. Please test as I have neither around and thus the patch is untested.

Thanks, this fixes the issue.
However, I still get an error

/home/dazzolin/swipl-devel/src/pl-builtin.h:377:21: error: ‘for’ loop initial declarations are only allowed in C99 mode
 #define WITH_LD(ld) for (PL_local_data_t *__PL_ld = (ld), *__loopctr = NULL; !__loopctr; __loopctr++)
                     ^

(and the same in many other positions). This is because (i think) the flag -std=c99 is not selected by default. Is it possible to specify it directly in the cmake file or add some checks?

For old gcc versions use

CFLAGS=-std=gnu99 cmake <options>

AFAIK there are virtually no still maintained versions of gcc for which C99 is not the default … What platform are you working on?

With lsb_release -a i get

LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.9.2009 (Core)
Release:        7.9.2009
Codename:       Core

This is an old cluster (not managed by me).
I was able to fix the compilation error only by adding set(CMAKE_C_STANDARD 99) in cmakelists.txt