grosjo / fts-xapian

Dovecot FTS plugin based on Xapian
GNU Lesser General Public License v2.1
91 stars 19 forks source link

warnings during build #121

Closed symphorien closed 2 years ago

symphorien commented 2 years ago

Some warnings are issued during compilation. I have opened a PR for those I could fix #120 but here are some I don't know how to fix:

fts-backend-xapian.cpp: At global scope:
fts-backend-xapian.cpp:769:1: warning: missing initializer for member 'fts_backend::header_filters' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmissing-field-initializers-Wmissing-field-initializers8;;]
  769 | };
      | ^
fts-backend-xapian.cpp:769:1: warning: missing initializer for member 'fts_backend::updating' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmissing-field-initializers-Wmissing-field-initializers8;;]

Uninitialized function pointers look quite serious.

grosjo commented 2 years ago

@symphorien not sure about this. HAve you tried with latest git ? What is your gcc version ?

symphorien commented 2 years ago

It still happens with current master 13f08da I use gcc-10.3.0 with -Wall -Wextra -fanalyzer dovecot version 2.3.18

grosjo commented 2 years ago

Do you have the same with fts-solr or fts-lucene ?

symphorien commented 2 years ago

The issue is definitely in fts-xapian: it tries to build a struct fts_backend with 3 fields:

https://github.com/grosjo/fts-xapian/blob/13f08da2e1ed13412e600348ce72982f2163572f/src/fts-backend-xapian.cpp#L749-L773

but this struct actually has 6 fields:

https://github.com/dovecot/core/blob/main/src/plugins/fts/fts-api-private.h#L83-L92

grosjo commented 2 years ago

But this is never done in any other plugin which use only 3 fields (see fts-squat, fts-solr, , fts-lucene)

symphorien commented 2 years ago

Well in that case, I suppose it's not a problem.