dovecot / imaptest

IMAP server tester
Other
51 stars 21 forks source link

Build Errors #20

Closed ArneVogel closed 1 year ago

ArneVogel commented 1 year ago

I am getting build errors when compiling imaptest.

Steps to reproduce:

  1. Using: wget https://dovecot.org/releases/2.3/dovecot-2.3.20.tar.gz or wget https://dovecot.org/releases/2.2/dovecot-2.2.36.4.tar.gz
  2. For each extracting and building with ./configure && make
  3. Getting latest imaptest: wget http://dovecot.org/nightly/imaptest/imaptest-latest.tar.gz
  4. Building with ./configure --with-dovecot=../dovecot-2.2.36.4 && make or ./configure --with-dovecot=../dovecot-2.3.20 && make

I get the following errors: With dovecot 2.2.36:

make[2]: Entering directory '/opt/vogel/imaptest/src'
  CC       imaptest-test-parser.o
test-parser.c: In function ‘test_parse_command_line’:
test-parser.c:535:38: error: macro "str_begins" passed 3 arguments, but takes just 2
  535 |  if (str_begins(line, "!ifenv ", &env) ||
      |                                      ^
In file included from /opt/vogel/dovecot-2.3.20/src/lib/lib.h:48,
                 from test-parser.c:3:
/opt/vogel/dovecot-2.3.20/src/lib/strfuncs.h:97: note: macro "str_begins" defined here
   97 | # define str_begins(h, n) (__builtin_constant_p(n) ? strncmp((h), (n), strlen(n))==0 : (str_begins)((h), (n)))
      | 
test-parser.c:535:6: warning: the address of ‘str_begins’ will always evaluate as ‘true’ [-Waddress]
  535 |  if (str_begins(line, "!ifenv ", &env) ||
      |      ^~~~~~~~~~
test-parser.c:536:39: error: macro "str_begins" passed 3 arguments, but takes just 2
  536 |      str_begins(line, "!ifnenv ", &env)) {
      |                                       ^
In file included from /opt/vogel/dovecot-2.3.20/src/lib/lib.h:48,
                 from test-parser.c:3:
/opt/vogel/dovecot-2.3.20/src/lib/strfuncs.h:97: note: macro "str_begins" defined here
   97 | # define str_begins(h, n) (__builtin_constant_p(n) ? strncmp((h), (n), strlen(n))==0 : (str_begins)((h), (n)))
      | 
test-parser.c:535:40: warning: the address of ‘str_begins’ will always evaluate as ‘true’ [-Waddress]
  535 |  if (str_begins(line, "!ifenv ", &env) ||
      |                                        ^~
test-parser.c:540:7: warning: implicit declaration of function ‘str_begins_with’; did you mean ‘str_begins’? [-Wimplicit-function-declaration]
  540 |   if (str_begins_with(line, "!ifnenv "))
      |       ^~~~~~~~~~~~~~~
      |       str_begins

With dovecot 2.3.20:

test-parser.c: In function ‘test_parse_header_line’:
test-parser.c:77:15: warning: implicit declaration of function ‘array_idx_get_space’; did you mean ‘array_insert_space’? [-Wimplicit-function-declaration]
   77 |   test_conn = array_idx_get_space(&test->connections, idx-1);
      |               ^~~~~~~~~~~~~~~~~~~
      |               array_insert_space
test-parser.c:77:13: warning: assignment to ‘struct test_connection *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   77 |   test_conn = array_idx_get_space(&test->connections, idx-1);
      |             ^
test-parser.c: In function ‘test_parse_imap_args’:
test-parser.c:165:25: error: storage size of ‘fatal’ isn’t known
  165 |  enum imap_parser_error fatal;
      |                         ^~~~~
test-parser.c:165:25: warning: unused variable ‘fatal’ [-Wunused-variable]
test-parser.c: In function ‘test_parse_command_line’:
test-parser.c:535:6: warning: implicit declaration of function ‘str_begins’; did you mean ‘str_len’? [-Wimplicit-function-declaration]
  535 |  if (str_begins(line, "!ifenv ", &env) ||
      |      ^~~~~~~~~~
      |      str_len
test-parser.c:540:7: warning: implicit declaration of function ‘str_begins_with’ [-Wimplicit-function-declaration]
  540 |   if (str_begins_with(line, "!ifnenv "))
      |       ^~~~~~~~~~~~~~~
test-parser.c: In function ‘test_parse_file’:
test-parser.c:787:7: warning: implicit declaration of function ‘i_stream_read_eof’; did you mean ‘i_stream_read_more’? [-Wimplicit-function-declaration]
  787 |  if (!i_stream_read_eof(input)) {
      |       ^~~~~~~~~~~~~~~~~
      |       i_stream_read_more
test-parser.c: In function ‘parser_has_logout’:
test-parser.c:823:2: warning: implicit declaration of function ‘array_foreach_elem’; did you mean ‘array_foreach_idx’? [-Wimplicit-function-declaration]
  823 |  array_foreach_elem(&test->cmd_groups, group) {
      |  ^~~~~~~~~~~~~~~~~~
      |  array_foreach_idx
test-parser.c:823:46: error: expected ‘;’ before ‘{’ token
  823 |  array_foreach_elem(&test->cmd_groups, group) {
      |                                              ^~
      |                                              ;
test-parser.c:821:29: warning: unused variable ‘cmd’ [-Wunused-variable]
  821 |  const struct test_command *cmd;
      |                             ^~~
test-parser.c:831:1: warning: no return statement in function returning non-void [-Wreturn-type]
  831 | }
      | ^
test-parser.c: In function ‘test_parser_read_test’:
test-parser.c:901:10: error: too few arguments to function ‘i_stream_create_fd’
  901 |  input = i_stream_create_fd(fd, (size_t)-1);
      |          ^~~~~~~~~~~~~~~~~~
In file included from test-parser.c:5:
/opt/vogel/dovecot-2.2.36.4/src/lib/istream.h:36:17: note: declared here
   36 | struct istream *i_stream_create_fd(int fd, size_t max_buffer_size,
      |                 ^~~~~~~~~~~~~~~~~~
test-parser.c: In function ‘test_parser_scan_dir’:
test-parser.c:955:44: error: expected ‘;’ before ‘{’ token
  955 |  array_foreach_elem(&test_paths, test_path) {
      |                                            ^~
      |                                            ;
test-parser.c:927:6: warning: unused variable ‘ret’ [-Wunused-variable]
  927 |  int ret = 0;
      |      ^~~
test-parser.c:921:53: warning: unused parameter ‘parser’ [-Wunused-parameter]
  921 | static int test_parser_scan_dir(struct test_parser *parser, const char *path)
      |                                 ~~~~~~~~~~~~~~~~~~~~^~~~~~
test-parser.c:964:1: warning: control reaches end of non-void function [-Wreturn-type]
  964 | }
      | ^
make[2]: *** [Makefile:882: imaptest-test-parser.o] Error 1
make[2]: Leaving directory '/opt/vogel/imaptest/src'
make[1]: *** [Makefile:484: all-recursive] Error 1
make[1]: Leaving directory '/opt/vogel/imaptest'
make: *** [Makefile:412: all] Error 2
sirainen commented 1 year ago

The git main branch of imaptest compiles only against git main branch of dovecot. If you want to compile it against v2.3.20, try release-2.3 branch.