]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix ARM NDEBUG Builds 19/3519/1
authorLionel Sambuc <lionel.sambuc@gmail.com>
Sat, 31 Mar 2018 17:34:03 +0000 (19:34 +0200)
committerLionel Sambuc <lionel.sambuc@gmail.com>
Sat, 31 Mar 2018 17:34:03 +0000 (19:34 +0200)
Change-Id: I1250744d54b75d6380393afe848a6eb8c5dc894d

24 files changed:
external/bsd/bind/bin/named/Makefile
external/bsd/bind/dist/lib/lwres/lwconfig.c
external/bsd/bind/lib/libdns/Makefile
external/bsd/bind/lib/libisc/Makefile
external/bsd/dhcp/lib/common/Makefile
external/bsd/dhcpcd/sbin/dhcpcd/Makefile
external/bsd/nvi/usr.bin/nvi/Makefile
external/bsd/tcpdump/bin/Makefile
external/public-domain/sqlite/lib/Makefile
lib/libbz2/Makefile
libexec/httpd/Makefile
minix/net/lwip/Makefile
minix/net/lwip/addr.c
minix/net/lwip/lldata.c
minix/net/lwip/rttree.c
minix/net/lwip/tcpisn.c
minix/net/uds/Makefile
minix/net/uds/io.c
minix/servers/mib/Makefile
minix/servers/vfs/Makefile
minix/servers/vfs/misc.c
sbin/ifconfig/Makefile
usr.bin/ftp/Makefile
usr.bin/m4/Makefile

index 95a4942e1705dbccc0e9d44b0691e4c236f1b71c..b2102422bcaf49c8a0cb32a7c16e3dd2d7185daa 100644 (file)
@@ -7,6 +7,10 @@ MAN=   named.8 lwresd.8 named.conf.5
 BINDIR=        /usr/sbin
 LINKS= ${BINDIR}/named ${BINDIR}/lwresd
 
+.if defined(__MINIX)
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif # defined(__MINIX)
+
 .include "${.CURDIR}/../Makefile.inc"
 
 DIST=${IDIST}/bin/named
index 28d1181791c3c9a37cb48770ada7380a14c8b383..3dff9000f281364da1fc055f7678b1cae55052ff 100644 (file)
@@ -606,15 +606,21 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
        FILE *fp = NULL;
        char word[256];
        lwres_result_t rval, ret;
+#if !defined(NDEBUG) && defined(__minix)
        lwres_conf_t *confdata;
+#endif /* !defined(NDEBUG) && defined(__minix) */
        int stopchar;
 
        REQUIRE(ctx != NULL);
+#if !defined(NDEBUG) && defined(__minix)
        confdata = &ctx->confdata;
+#endif /* !defined(NDEBUG) && defined(__minix) */
 
        REQUIRE(filename != NULL);
        REQUIRE(strlen(filename) > 0U);
+#if !defined(NDEBUG) && defined(__minix)
        REQUIRE(confdata != NULL);
+#endif /* !defined(NDEBUG) && defined(__minix) */
 
        errno = 0;
        if ((fp = fopen(filename, "r")) == NULL)
index 2dd7b53cef6184ad1de9ea6657ba22130c74a0b2..bafe8936bd89877efc72bf6b46709581ce63b978 100644 (file)
@@ -7,6 +7,11 @@ LIB=dns
 
 .include "${.CURDIR}/../Makefile.inc"
 
+.if defined(__MINIX)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Os
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif # defined(__MINIX)
+
 DIST=  ${IDIST}/lib/dns
 .include "${DIST}/api"
 .include "${DIST}/mapapi"
index 319912155d38e983129f644251447b8a6c651408..ec247b9e912c2586811837af4cc3bd82e37d85bb 100644 (file)
@@ -5,6 +5,11 @@ LIB=isc
 
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Os
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif # defined(__MINIX)
+
 .include "${.CURDIR}/../Makefile.inc"
 
 DIST=  ${IDIST}/lib/isc
index ef92a37fcc8dc8859b9eb4dce71fd1572ead8695..a6f2100cad89e059e337ae712429a16e561b1033 100644 (file)
@@ -12,3 +12,11 @@ MAN    = dhcp-options.5 dhcp-eval.5
 DHCPSRCDIR=    common
 
 .include <bsd.lib.mk>
+
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
index 55d01c71cd8a32b53fecd7514dd70907dd545b5c..2877e675270e1d919646526ed8c161778db2ec58 100644 (file)
@@ -14,6 +14,10 @@ CPPFLAGS+=   -DHAVE_CONFIG_H
 
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif # defined(__MINIX)
+
 SRCS+=         auth.c hmac_md5.c
 
 USE_INET?=     yes
index ccee9484bb777d12d977186782aa97aa84a2d8e9..d1756ae5cda85969c2cc0885b176ec852b3f4ae5 100644 (file)
@@ -6,6 +6,14 @@ USE_WIDECHAR?=yes
 
 CWARNFLAGS.clang+=     -Wno-uninitialized -Wno-format-security
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
+
 CPPFLAGS+=-I${DIST}/include -I${.CURDIR} -I. -DGTAGS
 #DBG=-g
 #CPPFLAGS+=-DLOGDEBUG -DTRACE
index e0e83b2991fd9bbd970974fdd4fadb6074365f8c..5caf234a1aa237287edbae9e14d5cba4e24f3ee2 100644 (file)
@@ -6,6 +6,12 @@ CWARNFLAGS.clang+=     -Wno-constant-logical-operand -Wno-error=unused-function
 
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+#LSC: -Wno-unused-but-set-variable while compiling with -DNDEBUG -O2
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -O3
+CWARNFLAGS.gcc+=       -Wno-unused-but-set-variable -Wno-maybe-uninitialized
+.endif # defined(__MINIX)
+
 USE_FORT?= yes # network client
 
 BINDIR=/usr/sbin
index 2e107ef997b4580f531f3b8ec9d6c04b1746bd3f..6e56bc2eb77fa37fa0c7b2f69a6c16c766937fa8 100644 (file)
@@ -18,6 +18,14 @@ CLEANFILES+=sqlite3.pc
 
 .include <bsd.lib.mk>
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
+
 all: sqlite3.pc
 dependall: all
 
index ef81827455b0f86aab3caecb239b5be88b2d6bd5..11b6c1b4911a22be38b5e416cee4d39fdba0359a 100644 (file)
@@ -15,6 +15,14 @@ SRCS=                blocksort.c huffman.c crctable.c randtable.c compress.c \
 INCS=          bzlib.h
 INCSDIR=       /usr/include
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
+
 # XXX huffman.c gets mis-compiled with 2.95.3
 .if ${MACHINE_ARCH} == "vax"
 COPTS+=                -O0
index db2e3e48e945cf046a21955426120a85ed05fb27..659b631eedf285455ad03339cc6f43f3ee943360 100644 (file)
@@ -50,6 +50,14 @@ LDADD+=              -lnbutil
 
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
+
 .if ${MKCRYPTO} != "no"
 
 LDADD+=        -lssl -lcrypto
index a463dcfcdfeea077ae0062dd6458fd8e5aac4a7b..15083862bd2eaeae57f0094126a8bcac5d09d29c 100644 (file)
@@ -31,4 +31,12 @@ LDADD+=      -llwip -lsockevent -lsockdriver -lchardriver -lsys -ltimers
 
 WARNS?=        5
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
+
 .include <minix.service.mk>
index 845092124a062cea2e5133eede715da6344ce034..246a31fa8700be0c67db7fe85c2ec2721656a5d0 100644 (file)
@@ -581,7 +581,10 @@ addr_put_netmask(struct sockaddr * addr, socklen_t * addr_len, uint8_t type,
 void
 addr_normalize(ip_addr_t * dst, const ip_addr_t * src, unsigned int prefix)
 {
-       unsigned int addr_len, byte, bit;
+#if !defined(NDEBUG)
+       unsigned int addr_len;
+#endif /* !defined(NDEBUG) */
+       unsigned int byte, bit;
        const uint8_t *srcaddr;
        uint8_t type, *dstaddr;
 
@@ -594,7 +597,9 @@ addr_normalize(ip_addr_t * dst, const ip_addr_t * src, unsigned int prefix)
        case IPADDR_TYPE_V4:
                srcaddr = (const uint8_t *)&ip_2_ip4(src)->addr;
                dstaddr = (uint8_t *)&ip_2_ip4(dst)->addr;
+#if !defined(NDEBUG)
                addr_len = sizeof(ip_2_ip4(src)->addr);
+#endif /* !defined(NDEBUG) */
 
                break;
 
@@ -603,7 +608,9 @@ addr_normalize(ip_addr_t * dst, const ip_addr_t * src, unsigned int prefix)
 
                srcaddr = (const uint8_t *)&ip_2_ip6(src)->addr;
                dstaddr = (uint8_t *)&ip_2_ip6(dst)->addr;
+#if !defined(NDEBUG)
                addr_len = sizeof(ip_2_ip6(src)->addr);
+#endif /* !defined(NDEBUG) */
 
                break;
 
index 80050c78cc26a0377cf0e3602ef7d0c04c5ad4d9..3867c3985ba2ed9fa2f1a22ae15b10d58a13534d 100644 (file)
@@ -425,9 +425,9 @@ lldata_ndp_get(lldata_ndp_num_t num, struct sockaddr_in6 * addr,
 {
        const ip6_addr_t *ip6addr;
        ip_addr_t ipaddr;
-       struct netif *netif;
+       struct netif *netif = NULL /*gcc*/;
        struct ifdev *ifdev;
-       const uint8_t *lladdr;
+       const uint8_t *lladdr = NULL /*gcc*/;
        socklen_t addr_len;
 
        ip6addr = nd6_get_neighbor_cache_entry(num, &netif, &lladdr,
index eb003346469c933f107f4866170b40034870aa12..73e22495ab932933f05dc2391bbcd562da295899 100644 (file)
@@ -476,7 +476,7 @@ rttree_add(struct rttree * tree, struct rttree_entry * entry,
 {
        struct rttree_node *node, *parent, *link;
        struct rttree_entry *other_entry;
-       unsigned int bit, side, side2;
+       unsigned int bit = 0 /*gcc*/, side, side2;
        int match;
 
        assert(mask != NULL || prefix == tree->rtt_bits);
index 382cf32c228e2ffaa191a6e56328f469eb262d3e..bf72bc7329987a995ebfbe6da147aaa635d7faf7 100644 (file)
@@ -78,7 +78,7 @@ tcpisn_secret(struct rmib_call * call __unused,
        struct rmib_newp * newp)
 {
        uint8_t secret[TCPISN_SECRET_HEX_LENGTH], byte, *p;
-       unsigned int i;
+       unsigned int i = 0 /*gcc*/;
        int r;
 
        /* First copy out the old (current) ISN secret. */
index a85c4483e9b5e5d3a4ec19fdf056f796aeea7b21..bf8ba954f65f5e8c69dfb228620982b1799ecb21 100644 (file)
@@ -10,6 +10,14 @@ FILESDIR= /etc/system.conf.d
 DPADD+=        ${LIBSOCKEVENT} ${LIBSOCKDRIVER} ${LIBSYS} ${LIBTIMERS}
 LDADD+=        -lsockevent -lsockdriver -lsys -ltimers
 
+.if !empty(DBG:M-Os) || !empty(CFLAGS:M-Os) || \
+       !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Os
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+
 WARNS?=        5
 
 .include <minix.service.mk>
index 37333c2969cf2ea5a163d1dc01224272673dff48..1c82940f0f2941b77cdcbd18d87ce87dcea5b3bf 100644 (file)
@@ -1694,7 +1694,7 @@ uds_recv(struct sock * sock, const struct sockdriver_data * data, size_t len,
        struct udssock *uds = (struct udssock *)sock;
        size_t seglen, datalen, reslen = 0 /*gcc*/, credpos = 0 /*gcc*/;
        unsigned int segflags;
-       int r, partial, may_block;
+       int r, partial, may_block = 0 /*gcc*/;
 
        dprintf(("UDS: recv(%d,%zu,%zu,%u,%u,0x%x)\n",
            uds_get_id(uds), len, (off != NULL) ? *off : 0, ctl_len,
index bc241a0e2ce902fd0470e5e4e5601e1846a1b434..6b482b5da65515fb09af00c8c53cfdc2cb95407b 100644 (file)
@@ -1,5 +1,13 @@
 # Makefile for the Management Information Base (MIB) server
 
+.include <bsd.own.mk>
+
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+
 PROG=  mib
 SRCS=  main.c tree.c remote.c kern.c vm.c hw.c proc.c minix.c
 
index c1ff239b98d9203c3a75a1cf1a007450356c87f1..a9595a381b9a2da898728d6bab2b5a3cd1b41627 100644 (file)
@@ -15,6 +15,11 @@ SRCS+=  gcov.c
 CPPFLAGS+= -DUSE_COVERAGE
 .endif
 
+.if defined(__MINIX)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -O3
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif # defined(__MINIX)
+
 CFLAGS+= -Wall -Wextra -Wno-sign-compare -Werror
 DPADD+=        ${LIBSYS} ${LIBTIMERS} ${LIBEXEC}
 LDADD+=        -lsys -ltimers -lexec -lmthread
index b9336f3cc79a75a4d3faffaa4773a02166ce3802..dfc65b424f748227a832724236507bca7dcb1023 100644 (file)
@@ -581,7 +581,10 @@ void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid)
  * The parent and child parameters tell who forked off whom. The file
  * system uses the same slot numbers as the kernel.  Only PM makes this call.
  */
-  struct fproc *cp, *pp;
+  struct fproc *cp;
+#if !defined(NDEBUG)
+  struct fproc *pp;
+#endif /* !defined(NDEBUG) */
   int i, parentno, childno;
   mutex_t c_fp_lock;
 
@@ -606,7 +609,9 @@ void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid)
 
   /* Increase the counters in the 'filp' table. */
   cp = &fproc[childno];
+#if !defined(NDEBUG)
   pp = &fproc[parentno];
+#endif /* !defined(NDEBUG) */
 
   for (i = 0; i < OPEN_MAX; i++)
        if (cp->fp_filp[i] != NULL) cp->fp_filp[i]->filp_count++;
@@ -615,8 +620,10 @@ void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid)
   cp->fp_pid = cpid;
   cp->fp_endpoint = cproc;
 
+#if !defined(NDEBUG)
   /* A forking process cannot possibly be suspended on anything. */
   assert(pp->fp_blocked_on == FP_BLOCKED_ON_NONE);
+#endif /* !defined(NDEBUG) */
 
   /* A child is not a process leader, not being revived, etc. */
   cp->fp_flags = FP_NOFLAGS;
index 2aef6ef46e5ab5b3c48ed9212c98aae51fc70a65..928025d39d0fa7f995fc4ef9f4e03ec9d4eaea8d 100644 (file)
@@ -10,6 +10,9 @@
 RUMPPRG=ifconfig
 MAN=   ifconfig.8
 
+.if defined(__MINIX)
+CWARNFLAGS.gcc+=       -Wno-unused-but-set-variable
+.endif # defined(__MINIX)
 #DBG+=-g
 SRCS= af_atalk.c af_link.c carp.c
 .if (${USE_INET6} != "no")
index fd33069668de9323cf8486e68d04a22af2a0fed9..a8aab2c418096dcd0735c5360e441a635402e498 100644 (file)
@@ -9,6 +9,14 @@ PROG=  ftp
 SRCS=  cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
        progressbar.c ruserpass.c util.c
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized -Wno-clobbered
+.endif
+.endif # defined(__MINIX)
+
 # Uncomment the following to provide defaults for gate-ftp operation
 #
 #CPPFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
index 26944ebc683f4cf05b314f5c4dbc498303be837c..d72b181bd917d5b50b07b9648565723b29b32ca2 100644 (file)
@@ -6,6 +6,14 @@
 #      if you want the paste & spaste macros.
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+.if !empty(DBG:M-Og) || !empty(CFLAGS:M-Og) || \
+       !empty(DBG:M-g) || !empty(CFLAGS:M-g)
+#LSC: -Wno-maybe-uninitialized while compiling with -DNDEBUG -Og
+CWARNFLAGS.gcc+=       -Wno-maybe-uninitialized
+.endif
+.endif # defined(__MINIX)
+
 PROG=          m4
 CPPFLAGS+=     -DEXTENDED -I${.CURDIR}/lib
 SRCS=  parser.y tokenizer.l eval.c expr.c look.c main.c misc.c gnum4.c trace.c