Following compiler errors were reported by clang with warning=4 (thanks to Joerg for testing )
rm -f .gdbinit
echo "set solib-absolute-prefix /home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64" > .gdbinit
# compile apropos_replacement/makemandb.o
/home/joerg/work/NetBSD/obj/cvs/tools/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wpointer-sign -Werror --sysroot=/home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64 -I/home/joerg/work/NetBSD/cvs/src/external/bsd/mdocml/dist -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -c makemandb.c
makemandb.c:437:10: error: assigning to 'char *' from 'const char [73]' discards qualifiers [-Werror]
sqlstr = "insert into mandb values (:section, :name, :name_desc, :desc, :md5_hash)";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
makemandb.c:538:9: error: assigning to 'char *' from 'const char [99]' discards qualifiers [-Werror]
sqlstr = "create virtual table mandb using fts4(section, name, name_desc, desc, \
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
makemandb.c:519:6: error: unused variable 'idx' [-Werror,-Wunused-variable]
int idx = -1;
^
makemandb.c:630:9: error: assigning to 'char *' from 'const char [47]' discards qualifiers [-Werror]
sqlstr = "select * from mandb where md5_hash = :md5_hash";
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
*** Failed target: makemandb.o
*** Failed command: /home/joerg/work/NetBSD/obj/cvs/tools/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wpointer-sign -Werror --sysroot=/home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64 -I/home/joerg/work/NetBSD/cvs/src/external/bsd/mdocml/dist -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -c makemandb.c
*** Error code 1 (continuing)
# compile apropos_replacement/sqlite3.o
/home/joerg/work/NetBSD/obj/cvs/tools/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wpointer-sign -Werror --sysroot=/home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64 -I/home/joerg/work/NetBSD/cvs/src/external/bsd/mdocml/dist -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -c sqlite3.c
sqlite3.c:13900:5: error: initializing 'char *' with an expression of type 'const char [10]' discards qualifiers [-Werror]
FUNCTION(julianday, -1, 0, 0, juliandayFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:191:1: note: instantiated from:
"julianday"
^~~~~~~~~~~
sqlite3.c:13901:5: error: initializing 'char *' with an expression of type 'const char [5]' discards qualifiers [-Werror]
FUNCTION(date, -1, 0, 0, dateFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:192:1: note: instantiated from:
"date"
^~~~~~
sqlite3.c:13902:5: error: initializing 'char *' with an expression of type 'const char [5]' discards qualifiers [-Werror]
FUNCTION(time, -1, 0, 0, timeFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:193:1: note: instantiated from:
"time"
^~~~~~
sqlite3.c:13903:5: error: initializing 'char *' with an expression of type 'const char [9]' discards qualifiers [-Werror]
FUNCTION(datetime, -1, 0, 0, datetimeFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:194:1: note: instantiated from:
"datetime"
^~~~~~~~~~
sqlite3.c:13904:5: error: initializing 'char *' with an expression of type 'const char [9]' discards qualifiers [-Werror]
FUNCTION(strftime, -1, 0, 0, strftimeFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:195:1: note: instantiated from:
"strftime"
^~~~~~~~~~
sqlite3.c:13905:5: error: initializing 'char *' with an expression of type 'const char [13]' discards qualifiers [-Werror]
FUNCTION(current_time, 0, 0, 0, ctimeFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:196:1: note: instantiated from:
"current_time"
^~~~~~~~~~~~~~
sqlite3.c:13906:5: error: initializing 'char *' with an expression of type 'const char [18]' discards qualifiers [-Werror]
FUNCTION(current_timestamp, 0, 0, 0, ctimestampFunc),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:197:1: note: instantiated from:
"current_timestamp"
^~~~~~~~~~~~~~~~~~~
sqlite3.c:13907:5: error: initializing 'char *' with an expression of type 'const char [13]' discards qualifiers [-Werror]
FUNCTION(current_date, 0, 0, 0, cdateFunc ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:9381:45: note: instantiated from:
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0}
^
<scratch space>:198:1: note: instantiated from:
"current_date"
^~~~~~~~~~~~~~
sqlite3.c:18954:17: error: assigning to 'char *' from 'const char [4]' discards qualifiers [-Werror]
bufpt = "NaN";
^ ~~~~~
sqlite3.c:18966:21: error: assigning to 'char *' from 'const char [5]' discards qualifiers [-Werror]
bufpt = "-Inf";
^ ~~~~~~
sqlite3.c:18968:21: error: assigning to 'char *' from 'const char [5]' discards qualifiers [-Werror]
bufpt = "+Inf";
^ ~~~~~~
sqlite3.c:18970:21: error: assigning to 'char *' from 'const char [4]' discards qualifiers [-Werror]
bufpt = "Inf";
^ ~~~~~
sqlite3.c:19103:17: error: assigning to 'char *' from 'const char [1]' discards qualifiers [-Werror]
bufpt = "";
^ ~~
sqlite3.c:19122:29: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror]
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:25124:8: error: assigning to 'char *' from 'const char [1]' discards qualifiers [-Werror]
zErr = "";
^ ~~
sqlite3.c:54835:48: error: passing 'const char [16]' to parameter of type 'char *' discards qualifiers [-Werror]
get4byte(&pBt->pPage1->aData[36]), "Main freelist: ");
^~~~~~~~~~~~~~~~~
sqlite3.c:54486:9: note: passing argument to parameter 'zContext' here
char *zContext /* Context for error messages */
^
sqlite3.c:54846:38: error: passing 'const char [21]' to parameter of type 'char *' discards qualifiers [-Werror]
checkTreePage(&sCheck, aRoot[i], "List of tree roots: ", NULL, NULL);
^~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:54570:9: note: passing argument to parameter 'zParentContext' here
char *zParentContext, /* Parent context */
^
sqlite3.c:57919:13: error: assigning to 'char *' from 'const char [7]' discards qualifiers [-Werror]
zP4 = "(blob)";
^ ~~~~~~~~
sqlite3.c:60916:13: error: initializing 'char *' with an expression of type 'const char [1]' discards qualifiers [-Werror]
= {0, "", (double)0, {0}, 0, MEM_Null, SQLITE_NULL, 0,
^~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Failed target: sqlite3.o
*** Failed command: /home/joerg/work/NetBSD/obj/cvs/tools/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wpointer-sign -Werror --sysroot=/home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64 -I/home/joerg/work/NetBSD/cvs/src/external/bsd/mdocml/dist -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -c sqlite3.c
*** Error code 1 (continuing)
# compile apropos_replacement/apropos.o
/home/joerg/work/NetBSD/obj/cvs/tools/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wpointer-sign -Werror --sysroot=/home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64 -I/home/joerg/work/NetBSD/cvs/src/external/bsd/mdocml/dist -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -c apropos.c
apropos.c:80:9: error: assigning to 'char *' from 'const char [173]' discards qualifiers [-Werror]
sqlstr = "select section, name, snippet(mandb, \"\033[1m\", \"\033[0m\", \"...\" )"
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
apropos.c:131:23: error: initializing 'char *' with an expression of type 'const char [2]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~
apropos.c:131:28: error: initializing 'char *' with an expression of type 'const char [6]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~~~~
apropos.c:131:37: error: initializing 'char *' with an expression of type 'const char [5]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~~~
apropos.c:131:45: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~~
apropos.c:131:52: error: initializing 'char *' with an expression of type 'const char [3]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~
apropos.c:131:58: error: initializing 'char *' with an expression of type 'const char [8]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~~~~~~
apropos.c:131:69: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~~
apropos.c:131:76: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
char *stopwords[] = {"a", "about", "also", "all", "an", "another", "and", "are",
^~~~~
apropos.c:132:2: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~
apropos.c:132:9: error: initializing 'char *' with an expression of type 'const char [3]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~
apropos.c:132:15: error: initializing 'char *' with an expression of type 'const char [3]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~
apropos.c:132:21: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~
apropos.c:132:28: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~
apropos.c:132:35: error: initializing 'char *' with an expression of type 'const char [5]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~~
apropos.c:132:43: error: initializing 'char *' with an expression of type 'const char [5]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~~
apropos.c:132:51: error: initializing 'char *' with an expression of type 'const char [6]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~~~
apropos.c:132:60: error: initializing 'char *' with an expression of type 'const char [4]' discards qualifiers [-Werror]
"how", "is", "or", "the", "how", "what", "when", "which", "why", NULL};
^~~~~
apropos.c:248:14: error: assigning to 'int *' from 'unsigned int *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
aMatchinfo = (unsigned int *)sqlite3_value_blob(apVal[0]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Failed target: apropos.o
*** Failed command: /home/joerg/work/NetBSD/obj/cvs/tools/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wpointer-sign -Werror --sysroot=/home/joerg/work/NetBSD/obj/cvs/amd64/destdir.amd64 -I/home/joerg/work/NetBSD/cvs/src/external/bsd/mdocml/dist -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -c apropos.c
*** Error code 1 (continuing)
`all' not remade because of errors.