Hello users of Dovecot!
Currently, Dovecot 2.3.21.1 compiles and runs fine on a Red Hat Linux clone with GCC 8.3.1. Now tried the brandnew sources of Dovecot 2.4.0, but to my surprise it doesn't even compile and I have no clue where to begin my debugging.
Besides some minor things (new OpenSSL version check not working, maybe because not using proper include files; and one library is missing -lrt to use clock_gettime), I'm totally stuck at compiling the new "src/lib-http/http-server-settings.c".
It fails while including "src/lib/macros.h" with the message "error: size of unnamed array is negative"
Dovecot 2.3.21.1 has no http-server-settings.c but a very similar macros.h which everbody seems to be happy about. So what is it that happens while compiling http-server-settings.c to make GCC fail?
I ran "./configure" with just LDFLAGS="-lrt -Wl,--no-as-needed" added, and then simply "make". Nothing special here. I'm happy with all the default settings and auto-detected options.
Full log of compilation messages is appended at the end of this message.
Any help is highly appreciated.
Currently I have no idea where to even start my search for a workaround or even a solution. Never had such problems with compiling Dovecot so far.
Thanks a lot in advance ... Andreas
====================================================================== Compilation messages where the error occurs:
Making all in lib-http
make[3]: Entering directory '/usr/local/src/dovecot-2.4.0/src/lib-http'
CC http-server-settings.lo
In file included from ../../src/lib/lib.h:37,
from http-server-settings.c:3:
../../src/lib/lib.h: In function ‘time_to_uint32’:
../../src/lib/lib.h:145:14: warning: comparison of integer expressions of different signedness: ‘time_t’ {aka ‘long int’} and ‘unsigned int’ [-Wsign-compare]
i_assert(ts <= UINT32_MAX);
^~
../../src/lib/macros.h:198:45: note: in definition of macro ‘unlikely’
# define unlikely(expr) (__builtin_expect((expr) ? 1 : 0, 0) != 0)
^~~~
../../src/lib/lib.h:145:2: note: in expansion of macro ‘i_assert’
i_assert(ts <= UINT32_MAX);
^~~~~~~~
In file included from http-server-settings.c:3:
../../src/lib/lib.h: In function ‘time_to_uint32_trunc’:
../../src/lib/lib.h:153:9: warning: comparison of integer expressions of different signedness: ‘time_t’ {aka ‘long int’} and ‘unsigned int’ [-Wsign-compare]
if (ts > UINT32_MAX)
^
In file included from ../../src/lib/lib.h:37,
from http-server-settings.c:3:
http-server-settings.c: At top level:
../../src/lib/macros.h:173:14: error: size of unnamed array is negative
(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
^
../../src/lib/macros.h:182:2: note: in expansion of macro ‘COMPILE_ERROR_IF_TRUE’
COMPILE_ERROR_IF_TRUE(
^~~~~~~~~~~~~~~~~~~~~
../../src/lib-settings/settings-parser.h:78:27: note: in expansion of macro ‘COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE’
{ .type = (_enum_type) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/lib-settings/settings-parser.h:125:2: note: in expansion of macro ‘SETTING_DEFINE_STRUCT_TYPE’
SETTING_DEFINE_STRUCT_TYPE(SET_SIZE, SET_FLAG_HIDDEN, uoff_t, key, name, struct_name)
^~~~~~~~~~~~~~~~~~~~~~~~~~
http-server-settings.c:13:2: note: in expansion of macro ‘SETTING_DEFINE_STRUCT_SIZE_HIDDEN’
SETTING_DEFINE_STRUCT_##type("http_server_"#name, name, struct http_server_settings)
^~~~~~~~~~~~~~~~~~~~~~
http-server-settings.c:34:2: note: in expansion of macro ‘DEF’
DEF(SIZE_HIDDEN, socket_send_buffer_size),
^~~
../../src/lib/macros.h:173:14: error: size of unnamed array is negative
(sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
^
../../src/lib/macros.h:182:2: note: in expansion of macro ‘COMPILE_ERROR_IF_TRUE’
COMPILE_ERROR_IF_TRUE(
^~~~~~~~~~~~~~~~~~~~~
../../src/lib-settings/settings-parser.h:78:27: note: in expansion of macro ‘COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE’
{ .type = (_enum_type) + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/lib-settings/settings-parser.h:125:2: note: in expansion of macro ‘SETTING_DEFINE_STRUCT_TYPE’
SETTING_DEFINE_STRUCT_TYPE(SET_SIZE, SET_FLAG_HIDDEN, uoff_t, key, name, struct_name)
^~~~~~~~~~~~~~~~~~~~~~~~~~
http-server-settings.c:13:2: note: in expansion of macro ‘SETTING_DEFINE_STRUCT_SIZE_HIDDEN’
SETTING_DEFINE_STRUCT_##type("http_server_"#name, name, struct http_server_settings)
^~~~~~~~~~~~~~~~~~~~~~
http-server-settings.c:35:2: note: in expansion of macro ‘DEF’
DEF(SIZE_HIDDEN, socket_recv_buffer_size),
^~~
make[3]: *** [Makefile:1007: http-server-settings.lo] Error 1
make[3]: Leaving directory '/usr/local/src/dovecot-2.4.0/src/lib-http'
make[2]: *** [Makefile:587: all-recursive] Error 1
make[2]: Leaving directory '/usr/local/src/dovecot-2.4.0/src'
make[1]: *** [Makefile:725: all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/dovecot-2.4.0'
make: *** [Makefile:567: all] Error 2