Fix ARM NDEBUG Builds

Change-Id: I1250744d54b75d6380393afe848a6eb8c5dc894d
This commit is contained in:
Lionel Sambuc 2018-03-31 19:34:03 +02:00
parent 35b65c5af1
commit 03ac74ede9
24 changed files with 139 additions and 7 deletions

View 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

View 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)

View 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"

View 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

View 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)

View 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

View 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

View 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

View 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

View 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

View 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

View 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>

View 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;

View 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,

View 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);

View 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. */

View 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>

View 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,

View 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

View 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

View 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;

View 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")

View 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

View 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