Fails to compile with new compilers due to `-Werror` (`notmuchfs.c:1088:6: error: ‘notmuch_database_add_message’ is deprecated: function deprecated as of libnotmuch 5.1 [-Werror=deprecated-declarations]`) #13
Using an up to date GCC (version 8.2.0, on Arch Linux), I get the following error when compiling:
cc -g -O2 -std=c99 -Wall -Wextra -Werror -D_FILE_OFFSET_BITS=64 -c -MD -o notmuchfs.o notmuchfs.c
notmuchfs.c: In function ‘notmuchfs_rename’:
notmuchfs.c:1088:6: error: ‘notmuch_database_add_message’ is deprecated: function deprecated as of libnotmuch 5.1 [-Werror=deprecated-declarations]
if (notmuch_database_add_message(p_ctx->db, trans_name_to, NULL) !=
^~
In file included from notmuchfs.c:66:
/usr/include/notmuch.h:637:1: note: declared here
notmuch_database_add_message (notmuch_database_t *database,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:37: notmuchfs.o] Error 1
Removing the -Werror from the Makefile works around the problem (Patch: http://ix.io/1lVo).
Consider adapting the code that it also compiles nicely with -Werror.
Also, by that way, compilation could be carried out with -O3 instead of -O2 (at least it seems to work for me).
Using an up to date GCC (version 8.2.0, on Arch Linux), I get the following error when compiling:
Removing the
-Werror
from theMakefile
works around the problem (Patch: http://ix.io/1lVo).Consider adapting the code that it also compiles nicely with
-Werror
.Also, by that way, compilation could be carried out with
-O3
instead of-O2
(at least it seems to work for me).