Yes

https://github.com/grosjo/fts-xapian/commit/e183253be394cad07f17885600d9a652a4e862e8

On 2025-02-15 22:47, Aki Tuomi wrote:

Do you have the code somewhere pushed?

Aki

On 15/02/2025 16:44 EET Joan Moreau via dovecot <dovecot@dovecot.org> wrote:

I fixed all that but the error I get is the one I wrote

On 2025-02-15 22:39, Aki Tuomi via dovecot wrote:

On 15/02/2025 16:20 EET Joan Moreau via dovecot <dovecot@dovecot.org>
wrote:

Hi

Using latest git, I get 2 very weird errors

2 - Trying to adjust my plugin (FTS Xapian) to latest git, I get :

make[2]: Entering directory '/files/src/fts-xapian/src'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I..  -O2 -I/usr/include/dovecot      -DFTS_MAIL_USER_INIT_FOUR_ARGS=1
-g -O2 -std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=2   -O2 -MT fts-xapian-plugin.lo -MD -MP -MF
.deps/fts-xapian-plugin.Tpo -c -o fts-xapian-plugin.lo
fts-xapian-plugin.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O2
-I/usr/include/dovecot -DFTS_MAIL_USER_INIT_FOUR_ARGS=1 -g -O2
-std=gnu99 -fstack-protector-strong -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=2 -O2 -MT fts-xapian-plugin.lo -MD -MP -MF
.deps/fts-xapian-plugin.Tpo -c fts-xapian-plugin.c  -fPIC -DPIC -o
.libs/fts-xapian-plugin.o
In file included from /usr/include/dovecot/lib.h:37,
from fts-xapian-plugin.h:7,
from fts-xapian-plugin.c:3:
/usr/include/dovecot/macros.h:173:21: error: size of unnamed array is
negative
173 |         (sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE
: FALSE)
|                     ^

The first line of fts-xapian-plugin.h is

#include "lib.h" (nothing else before)

Your help welcome

Thank you so muich
I guess you fixed your xapian plugin also against main, instead of
release-2.4.0. It probably needs some changes, if you did that.

This is what I get after doing autoreconf -vi and configure.

fts-xapian-plugin.c: In function 'fts_xapian_mail_user_deinit':
fts-xapian-plugin.c:18:9: warning: implicit declaration of function
'fts_mail_user_deinit'; did you mean 'fts_mail_user_init'?
[-Wimplicit-function-declaration]
18 |         fts_mail_user_deinit(user);
|         ^~~~~~~~~~~~~~~~~~~~
|         fts_mail_user_init
fts-xapian-plugin.c: In function 'fts_xapian_mail_user_created':
fts-xapian-plugin.c:36:28: warning: implicit declaration of function
'mail_user_plugin_getenv'; did you mean 'mail_user_is_plugin_loaded'?
[-Wimplicit-function-declaration]
36 |         const char * env = mail_user_plugin_getenv(user,
"fts_xapian");
|                            ^~~~~~~~~~~~~~~~~~~~~~~
|                            mail_user_is_plugin_loaded
fts-xapian-plugin.c:36:28: warning: initialization of 'const char *'
from 'int' makes pointer from integer without a cast [-Wint-conversion]
fts-xapian-plugin.c:95:38: warning: passing argument 2 of
'fts_mail_user_init' from incompatible pointer type
[-Wincompatible-pointer-types]
95 |         if (fts_mail_user_init(user, &error) < 0)
|                                      ^~~~~~
|                                      |
|                                      const char **
In file included from fts-xapian-plugin.h:11,
from fts-xapian-plugin.c:4:
/home/cmouse/dovecot/include/dovecot/fts-user.h:10:62: note: expected
'struct event *' but argument is of type 'const char **'
10 | int fts_mail_user_init(struct mail_user *user, struct event
*event,
|                                                ~~~~~~~~~~~~~~^~~~~
fts-xapian-plugin.c:95:13: error: too few arguments to function
'fts_mail_user_init'
95 |         if (fts_mail_user_init(user, &error) < 0)
|             ^~~~~~~~~~~~~~~~~~
/home/cmouse/dovecot/include/dovecot/fts-user.h:10:5: note: declared
here
10 | int fts_mail_user_init(struct mail_user *user, struct event
*event,
|     ^~~~~~~~~~~~~~~~~~
fts-xapian-plugin.h: At top level:
fts-xapian-plugin.h:72:21: warning: 'chars_sep' defined but not used
[-Wunused-variable]
72 | static const char * chars_sep[] = { "\"", "\r", "\n", "\t", ",",
":", ";", "(", ")", "?", "!", "¿", "¡", "\u00A0", "'", """ };
|                     ^~~~~~~~~
fts-xapian-plugin.h:69:21: warning: 'chars_pb' defined but not used
[-Wunused-variable]
69 | static const char * chars_pb[] = { "<", ">", ".", "-", "@", "&",
"%", "*", "|", "`", "#", "^", "\\", "'", "/", "~", "[", "]", "{", "}",
"-" };
|                     ^~~~~~~~
fts-xapian-plugin.h:63:21: warning: 'suffixDict' defined but not used
[-Wunused-variable]
63 | static const char * suffixDict = "_dict.db";
|                     ^~~~~~~~~~
fts-xapian-plugin.h:62:21: warning: 'searchDict2' defined but not used
[-Wunused-variable]
62 | static const char * searchDict2 = " ORDER BY len LIMIT 100";
|                     ^~~~~~~~~~~
fts-xapian-plugin.h:61:21: warning: 'searchDict1' defined but not used
[-Wunused-variable]
61 | static const char * searchDict1 = "SELECT keyword FROM dict WHERE
keyword like '%";
|                     ^~~~~~~~~~~
fts-xapian-plugin.h:60:21: warning: 'flushTmpWords' defined but not
used [-Wunused-variable]
60 | static const char * flushTmpWords = "BEGIN TRANSACTION; INSERT OR
IGNORE INTO main.dict SELECT keyword, header, len FROM work.dict;
DELETE FROM work.dict; COMMIT;";
|                     ^~~~~~~~~~~~~
fts-xapian-plugin.h:59:21: warning: 'replaceTmpWord' defined but not
used [-Wunused-variable]
59 | static const char * replaceTmpWord ="INSERT OR IGNORE INTO
work.dict VALUES('";
|                     ^~~~~~~~~~~~~~
fts-xapian-plugin.h:58:21: warning: 'createTmpTable' defined but not
used [-Wunused-variable]
58 | static const char * createTmpTable = "ATTACH DATABASE ':memory:'
AS work; CREATE TABLE work.dict (keyword TEXT COLLATE NOCASE, header
INTEGER, len INTEGER, UNIQUE(keyword,header) ); CREATE INDEX IF NOT
EXISTS work.dict_h ON dict(header)";
|                     ^~~~~~~~~~~~~~
fts-xapian-plugin.h:57:21: warning: 'createDictIndexes' defined but not
used [-Wunused-variable]
57 | static const char * createDictIndexes = "CREATE INDEX IF NOT
EXISTS dict_len ON dict (len); CREATE INDEX IF NOT EXISTS dict_h ON
dict(header); CREATE INDEX IF NOT EXISTS dict_t ON dict(keyword);";
|                     ^~~~~~~~~~~~~~~~~
fts-xapian-plugin.h:56:21: warning: 'createDictTable' defined but not
used [-Wunused-variable]
56 | static const char * createDictTable = "CREATE TABLE IF NOT EXISTS
dict (keyword TEXT COLLATE NOCASE, header INTEGER, len INTEGER,
UNIQUE(keyword,header));";
|                     ^~~~~~~~~~~~~~~
fts-xapian-plugin.h:54:21: warning: 'suffixExp' defined but not used
[-Wunused-variable]
54 | static const char * suffixExp = "_exp.db";
|                     ^~~~~~~~~
fts-xapian-plugin.h:53:21: warning: 'deleteExpUID' defined but not used
[-Wunused-variable]
53 | static const char * deleteExpUID = "delete from expunges where
ID=%d;";
|                     ^~~~~~~~~~~~
fts-xapian-plugin.h:52:21: warning: 'replaceExpUID' defined but not
used [-Wunused-variable]
52 | static const char * replaceExpUID = "replace into expunges values
(%d);";
|                     ^~~~~~~~~~~~~
fts-xapian-plugin.h:51:21: warning: 'selectExpUIDs' defined but not
used [-Wunused-variable]
51 | static const char * selectExpUIDs = "select ID from expunges;";
|                     ^~~~~~~~~~~~~
fts-xapian-plugin.h:50:21: warning: 'createExpTable' defined but not
used [-Wunused-variable]
50 | static const char * createExpTable = "CREATE TABLE IF NOT EXISTS
expunges(ID INTEGER PRIMARY KEY NOT NULL);";
|                     ^~~~~~~~~~~~~~
fts-xapian-plugin.h:47:21: warning: 'hdrs_query' defined but not used
[-Wunused-variable]
47 | static const char * hdrs_query[HDRS_NB]  =  { "a",   "b",
"c",    "d",   "d",   "e",    "f",         "g",      "h",    "i",   "h"
};
|                     ^~~~~~~~~~
fts-xapian-plugin.h:46:21: warning: 'hdrs_xapian' defined but not used
[-Wunused-variable]
46 | static const char * hdrs_xapian[HDRS_NB] =  { "Q",   "S",
"A",    "XTO", "XCC", "XBCC", "XMID",      "XLIST",  "XBDY", "XCT",
"XBDY" };
|                     ^~~~~~~~~~~
fts-xapian-plugin.h:45:21: warning: 'hdrs_emails' defined but not used
[-Wunused-variable]
45 | static const char * hdrs_emails[HDRS_NB] =  { "uid", "subject",
"from", "to",  "cc",  "bcc",  "messageid", "listid", "body",
"contenttype", ""  };
|                     ^~~~~~~~~~~
make[2]: *** [Makefile:572: fts-xapian-plugin.lo] Error 1
make[2]: Leaving directory '/home/cmouse/projects/fts-xapian/src'
make[1]: *** [Makefile:504: all-recursive] Error 1
make[1]: Leaving directory '/home/cmouse/projects/fts-xapian'
make: *** [Makefile:426: all] Error 2

Aki

_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org
 _______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to