From: Lionel Sambuc Date: Sat, 23 Jan 2016 10:45:33 +0000 (+0100) Subject: Fix ARM noassert builds -g/-O{s/0/1/2/3} X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=e1cdaee10649323af446eb1a74571984b2ab3181;p=minix.git Fix ARM noassert builds -g/-O{s/0/1/2/3} Also fixes ARM assert build -O3. Change-Id: I52bda91308ecfa0e8b23c4140c38c49347cc10f7 --- diff --git a/crypto/external/bsd/netpgp/dist/src/netpgpverify/bignum.c b/crypto/external/bsd/netpgp/dist/src/netpgpverify/bignum.c index f02b512d0..09148f483 100644 --- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/bignum.c +++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/bignum.c @@ -4065,6 +4065,9 @@ fast_exponent_modulo(mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode */ int (*redux)(mp_int*,mp_int*,mp_digit); +#if defined(__minix) + mp = 0; /* LSC: Fix -Os compilation: -Werror=maybe-uninitialized */ +#endif /* defined(__minix) */ winsize = find_window_size(X); /* init M array */ diff --git a/crypto/external/bsd/netpgp/lib/verify/Makefile b/crypto/external/bsd/netpgp/lib/verify/Makefile index dd234f0d6..3e43b6969 100644 --- a/crypto/external/bsd/netpgp/lib/verify/Makefile +++ b/crypto/external/bsd/netpgp/lib/verify/Makefile @@ -19,6 +19,14 @@ SRCS+=tiger.c CPPFLAGS+=-I${.CURDIR} -I${EXTDIST}/src/netpgpverify MAN=libnetpgpverify.3 WARNS=5 +#.if defined(__MINIX) +#LSC: While Compiling with -O3: +#<..>/lib/verify/../../dist/src/netpgpverify/bignum.c:802:5: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow] +# if (olduse > ix) { +# ^ +# cc1: all warnings being treated as errors +CWARNFLAGS+= -Wno-strict-overflow +#.endif # defined(__MINIX) EXTDIST=${.CURDIR}/../../dist .PATH: ${EXTDIST}/src/netpgpverify diff --git a/external/bsd/atf/dist/atf-c/detail/fs.c b/external/bsd/atf/dist/atf-c/detail/fs.c index 48b892136..f2c100d63 100644 --- a/external/bsd/atf/dist/atf-c/detail/fs.c +++ b/external/bsd/atf/dist/atf-c/detail/fs.c @@ -301,14 +301,21 @@ static void replace_contents(atf_fs_path_t *p, const char *buf) { +#if !defined(NDEBUG) && defined(__minix) atf_error_t err; PRE(atf_dynstr_length(&p->m_data) == strlen(buf)); +#endif /* !defined(NDEBUG) && defined(__minix) */ atf_dynstr_clear(&p->m_data); - err = atf_dynstr_append_fmt(&p->m_data, "%s", buf); +#if !defined(NDEBUG) && defined(__minix) + err = +#endif /* !defined(NDEBUG) && defined(__minix) */ + atf_dynstr_append_fmt(&p->m_data, "%s", buf); +#if !defined(NDEBUG) && defined(__minix) INV(!atf_is_error(err)); +#endif /* !defined(NDEBUG) && defined(__minix) */ } static diff --git a/external/bsd/atf/dist/tools/process.cpp b/external/bsd/atf/dist/tools/process.cpp index cdc6ee709..e06b5c5d2 100644 --- a/external/bsd/atf/dist/tools/process.cpp +++ b/external/bsd/atf/dist/tools/process.cpp @@ -115,7 +115,10 @@ detail::do_exec(void *v) if (ea->m_prehook != NULL) ea->m_prehook(); - const int ret = const_execvp(ea->m_prog.c_str(), ea->m_argv.exec_argv()); +#if !defined(NDEBUG) && defined(__minix) + const int ret = +#endif /* !defined(NDEBUG) && defined(__minix) */ + const_execvp(ea->m_prog.c_str(), ea->m_argv.exec_argv()); const int errnocopy = errno; assert(ret == -1); std::cerr << "exec(" << ea->m_prog.str() << ") failed: " diff --git a/external/bsd/atf/dist/tools/test-program.cpp b/external/bsd/atf/dist/tools/test-program.cpp index c5d23be51..f8d2c95b7 100644 --- a/external/bsd/atf/dist/tools/test-program.cpp +++ b/external/bsd/atf/dist/tools/test-program.cpp @@ -254,7 +254,10 @@ static void prepare_child(const tools::fs::path& workdir) { - const int ret = ::setpgid(::getpid(), 0); +#if !defined(NDEBUG) && defined(__minix) + const int ret = +#endif /* !defined(NDEBUG) && defined(__minix) */ + ::setpgid(::getpid(), 0); assert(ret != -1); ::umask(S_IWGRP | S_IWOTH); diff --git a/external/bsd/atf/dist/tools/timers.cpp b/external/bsd/atf/dist/tools/timers.cpp index d8ab976a6..fb4b9a0b1 100644 --- a/external/bsd/atf/dist/tools/timers.cpp +++ b/external/bsd/atf/dist/tools/timers.cpp @@ -113,12 +113,18 @@ impl::timer::timer(const unsigned int seconds) : impl::timer::~timer(void) { +#if !defined(NDEBUG) && defined(__minix) int ret; - ret = ::timer_delete(m_pimpl->m_timer); + ret = +#endif /* !defined(NDEBUG) && defined(__minix) */ + ::timer_delete(m_pimpl->m_timer); assert(ret != -1); - ret = ::sigaction(SIGALRM, &m_pimpl->m_old_sa, NULL); +#if !defined(NDEBUG) && defined(__minix) + ret = +#endif /* !defined(NDEBUG) && defined(__minix) */ + ::sigaction(SIGALRM, &m_pimpl->m_old_sa, NULL); assert(ret != -1); } diff --git a/external/bsd/bzip2/dist/compress.c b/external/bsd/bzip2/dist/compress.c index c3b862c0d..26d86d8ea 100644 --- a/external/bsd/bzip2/dist/compress.c +++ b/external/bsd/bzip2/dist/compress.c @@ -258,6 +258,10 @@ void sendMTFValues ( EState* s ) UInt16 cost[BZ_N_GROUPS]; Int32 fave[BZ_N_GROUPS]; +#if defined(__minix) + /* LSC: Fix -Os compilation: -Werror=maybe-uninitialized */ + memset(cost, 0, sizeof(cost)); +#endif /* defined(__minix) */ UInt16* mtfv = s->mtfv; if (s->verbosity >= 3) diff --git a/external/bsd/kyua-cli/dist/utils/sanity.cpp b/external/bsd/kyua-cli/dist/utils/sanity.cpp index 4d9656831..cfba6e99b 100644 --- a/external/bsd/kyua-cli/dist/utils/sanity.cpp +++ b/external/bsd/kyua-cli/dist/utils/sanity.cpp @@ -183,12 +183,16 @@ utils::sanity_failure(const assert_type type, const char* file, void utils::install_crash_handlers(const std::string& logfile_) { +#if !defined(NDEBUG) && defined(__minix) static bool installed = false; +#endif /* !defined(NDEBUG) && defined(__minix) */ PRE(!installed); logfile = logfile_; for (const int* iter = &fatal_signals[0]; *iter != 0; iter++) install_one_crash_handler(*iter); +#if !defined(NDEBUG) && defined(__minix) installed = true; +#endif /* !defined(NDEBUG) && defined(__minix) */ } diff --git a/external/bsd/kyua-testers/dist/atf_list.c b/external/bsd/kyua-testers/dist/atf_list.c index b6d46a8c9..71572dd93 100644 --- a/external/bsd/kyua-testers/dist/atf_list.c +++ b/external/bsd/kyua-testers/dist/atf_list.c @@ -257,6 +257,10 @@ parse_test_case(FILE* input, FILE* output, char* name) fgets_no_newline(line, sizeof(line), input) != NULL && strcmp(line, "") != 0) { char* key; char* value; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized, with -O3 */ + key = value = NULL; +#endif /* defined(__minix) */ error = parse_property(line, &key, &value); if (!kyua_error_is_set(error)) { const char* out_key = rewrite_property(key); @@ -301,6 +305,10 @@ parse_tests(FILE* input, FILE* output) do { char* key; char* value; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized, with -O3 */ + key = value = NULL; +#endif /* defined(__minix) */ error = parse_property(line, &key, &value); if (kyua_error_is_set(error)) break; diff --git a/external/bsd/libarchive/dist/libarchive/archive_read_support_format_mtree.c b/external/bsd/libarchive/dist/libarchive/archive_read_support_format_mtree.c index 21d421e31..ef4fe8437 100644 --- a/external/bsd/libarchive/dist/libarchive/archive_read_support_format_mtree.c +++ b/external/bsd/libarchive/dist/libarchive/archive_read_support_format_mtree.c @@ -393,6 +393,9 @@ read_mtree(struct archive_read *a, struct mtree *mtree) struct mtree_entry *last_entry; int r; +#if defined(__minix) + p = NULL; /* LSC: Fix -Os compilation: -Werror=maybe-uninitialized */ +#endif /* defined(__minix) */ mtree->archive_format = ARCHIVE_FORMAT_MTREE; mtree->archive_format_name = "mtree"; diff --git a/external/bsd/mdocml/dist/mdoc_validate.c b/external/bsd/mdocml/dist/mdoc_validate.c index 01aaa5f2d..e87936667 100644 --- a/external/bsd/mdocml/dist/mdoc_validate.c +++ b/external/bsd/mdocml/dist/mdoc_validate.c @@ -597,9 +597,12 @@ pre_bl(PRE_ARGS) int i, comp, dup; const char *offs, *width; enum mdoc_list lt; +#if !defined(NDEBUG) && defined(__minix) struct mdoc_node *np; +#endif /* !defined(NDEBUG) && defined(__minix) */ if (MDOC_BLOCK != n->type) { +#if !defined(NDEBUG) && defined(__minix) if (ENDBODY_NOT != n->end) { assert(n->pending); np = n->pending->parent; @@ -609,6 +612,7 @@ pre_bl(PRE_ARGS) assert(np); assert(MDOC_BLOCK == np->type); assert(MDOC_Bl == np->tok); +#endif /* !defined(NDEBUG) && defined(__minix) */ return(1); } @@ -783,9 +787,12 @@ pre_bd(PRE_ARGS) int i, dup, comp; enum mdoc_disp dt; const char *offs; +#if !defined(NDEBUG) && defined(__minix) struct mdoc_node *np; +#endif /* !defined(NDEBUG) && defined(__minix) */ if (MDOC_BLOCK != n->type) { +#if !defined(NDEBUG) && defined(__minix) if (ENDBODY_NOT != n->end) { assert(n->pending); np = n->pending->parent; @@ -795,6 +802,7 @@ pre_bd(PRE_ARGS) assert(np); assert(MDOC_BLOCK == np->type); assert(MDOC_Bd == np->tok); +#endif /* !defined(NDEBUG) && defined(__minix) */ return(1); } diff --git a/external/bsd/nvi/dist/vi/vs_smap.c b/external/bsd/nvi/dist/vi/vs_smap.c index 1289a819c..c332ce13f 100644 --- a/external/bsd/nvi/dist/vi/vs_smap.c +++ b/external/bsd/nvi/dist/vi/vs_smap.c @@ -582,6 +582,10 @@ vs_sm_up(SCR *sp, MARK *rp, db_recno_t count, scroll_t scmd, SMAP *smp) { int cursor_set, echanged, zset; SMAP *ssmp, s1, s2; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized, with -O3 */ + ssmp = NULL; +#endif /* defined(__minix) */ /* * Check to see if movement is possible. diff --git a/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c b/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c index e183689cc..1ee941a8a 100644 --- a/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c +++ b/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c @@ -450,6 +450,9 @@ parse_pkg_vuln(const char *input, size_t input_len, int check_sum) size_t allocated_vulns; int in_pgp_msg; +#if defined(__minix) + next = NULL; /* LSC: Fix -Os compilation: -Werror=maybe-uninitialized */ +#endif /* defined(__minix) */ pv = xmalloc(sizeof(*pv)); allocated_vulns = pv->entries = 0; diff --git a/external/bsd/tmux/dist/screen-redraw.c b/external/bsd/tmux/dist/screen-redraw.c index 4b9c95e0b..621022a47 100644 --- a/external/bsd/tmux/dist/screen-redraw.c +++ b/external/bsd/tmux/dist/screen-redraw.c @@ -281,6 +281,10 @@ screen_redraw_draw_borders(struct client *c, int status, u_int top) struct grid_cell active_gc, other_gc; u_int i, j, type; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized while compiling with -O3 */ + wp = NULL; +#endif /* defined(__minix) */ style_apply(&other_gc, oo, "pane-border-style"); style_apply(&active_gc, oo, "pane-active-border-style"); active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET; diff --git a/external/bsd/top/dist/commands.c b/external/bsd/top/dist/commands.c index 03418f184..c0dd6add3 100644 --- a/external/bsd/top/dist/commands.c +++ b/external/bsd/top/dist/commands.c @@ -477,6 +477,10 @@ renice_procs(char *str) int procnum; int uid; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized while compiling with -O3. */ + prio = 0; +#endif /* defined(__minix) */ ERR_RESET; uid = getuid(); diff --git a/external/public-domain/sqlite/dist/sqlite3.c b/external/public-domain/sqlite/dist/sqlite3.c index 7422cebbe..7a635c4b6 100644 --- a/external/public-domain/sqlite/dist/sqlite3.c +++ b/external/public-domain/sqlite/dist/sqlite3.c @@ -57331,6 +57331,14 @@ static int balance_nonroot( ** intkey b-tree, then cell i was a divider cell. */ assert( j+1 < ArraySize(apCopy) ); assert( j+1 < nOld ); +#if defined(__minix) + /*LSC: While compiling with -O3: + * error: array subscript is above array bounds [-Werror=array-bounds] + * pOld = apCopy[++j]; + */ + if (!(j+1 < ArraySize(apCopy))) + abort(); +#endif /* defined(__minix) */ pOld = apCopy[++j]; iNextOld = i + !leafData + pOld->nCell + pOld->nOverflow; if( pOld->nOverflow ){ @@ -140544,6 +140552,9 @@ SQLITE_PRIVATE void sqlite3Fts3Snippet( for(iRead=0; iReadnColumn; iRead++){ SnippetFragment sF = {0, 0, 0, 0}; int iS; +#if defined(__minix) + iS = 0; /* LSC: Fix -Os compilation: -Werror=maybe-uninitialized */ +#endif /* defined(__minix) */ if( iCol>=0 && iRead!=iCol ) continue; /* Find the best snippet of nFToken tokens in column iRead. */ diff --git a/games/rogue/level.c b/games/rogue/level.c index 4b95277bc..3cc4fb8d4 100644 --- a/games/rogue/level.c +++ b/games/rogue/level.c @@ -540,6 +540,10 @@ fill_it(int rn, boolean do_rec_de) static short offsets[4] = {-1, 1, 3, -3}; boolean did_this = 0; +#if defined(__minix) + /* LSC: maybe-uninitialized, when compiling with -O3 */ + drow = dcol = 0; +#endif /* defined(__minix)*/ for (i = 0; i < 10; i++) { srow = get_rand(0, 3); scol = get_rand(0, 3); diff --git a/minix/lib/libdevman/generic.c b/minix/lib/libdevman/generic.c index ca510c5c3..46bbbf727 100644 --- a/minix/lib/libdevman/generic.c +++ b/minix/lib/libdevman/generic.c @@ -103,7 +103,7 @@ int devman_add_device(struct devman_dev *dev) { message msg; int res; - size_t grant_size; + size_t grant_size = 0; void *buf = serialize_dev(dev, &grant_size); if (buf == NULL) diff --git a/minix/lib/libsys/sef_liveupdate.c b/minix/lib/libsys/sef_liveupdate.c index e326d28da..34e19ab45 100644 --- a/minix/lib/libsys/sef_liveupdate.c +++ b/minix/lib/libsys/sef_liveupdate.c @@ -241,7 +241,8 @@ static void sef_lu_state_change(int state, int flags) sef_lu_flags = flags; if(sef_lu_state == SEF_LU_STATE_NULL) { r = sys_statectl(SYS_STATE_CLEAR_IPC_FILTERS, 0, 0); - assert(r == OK); + if(r != OK) + panic("%s:%d: SYS_STATE_CLEAR_IPC_FILTERS failed\n", __func__, __LINE__); } if(old_state != sef_lu_state) { sef_lu_cbs.sef_cb_lu_state_changed(old_state, sef_lu_state); diff --git a/minix/net/lwip/tcp.c b/minix/net/lwip/tcp.c index 1f4fc3d14..adcfb12ce 100644 --- a/minix/net/lwip/tcp.c +++ b/minix/net/lwip/tcp.c @@ -165,7 +165,8 @@ static int tcp_op_close(struct socket * sock) } err = tcp_close(sock->pcb); - assert(err == ERR_OK); + if(err != ERR_OK) + panic("tcp_close failed\n"); sock->pcb = NULL; } debug_tcp_print("freed pcb"); diff --git a/minix/servers/vfs/misc.c b/minix/servers/vfs/misc.c index 29a97fb49..b47bbd0d7 100644 --- a/minix/servers/vfs/misc.c +++ b/minix/servers/vfs/misc.c @@ -386,7 +386,10 @@ int do_vm_call(void) u32_t length = job_m_in.VFS_VMCALL_LENGTH; int result = OK; int slot; - struct fproc *rfp, *vmf; + struct fproc *rfp; +#if !defined(NDEBUG) + struct fproc *vmf; +#endif /* !defined(NDEBUG) */ struct filp *f = NULL; int r; @@ -396,7 +399,9 @@ int do_vm_call(void) if(isokendpt(ep, &slot) != OK) rfp = NULL; else rfp = &fproc[slot]; +#if !defined(NDEBUG) vmf = fproc_addr(VM_PROC_NR); +#endif /* !defined(NDEBUG) */ assert(fp == vmf); assert(rfp != vmf); diff --git a/minix/servers/vfs/open.c b/minix/servers/vfs/open.c index 0ca684854..0a8f91af6 100644 --- a/minix/servers/vfs/open.c +++ b/minix/servers/vfs/open.c @@ -645,7 +645,7 @@ int actual_lseek(struct fproc *rfp, int seekfd, int seekwhence, off_t offset, int do_lseek(void) { /* Perform the lseek(2) system call. */ - off_t newpos; + off_t newpos = 0; int r; if ((r = actual_lseek(fp, job_m_in.m_lc_vfs_lseek.fd, diff --git a/sbin/newfs_udf/udf_create.c b/sbin/newfs_udf/udf_create.c index 0d6163abb..ef92874af 100644 --- a/sbin/newfs_udf/udf_create.c +++ b/sbin/newfs_udf/udf_create.c @@ -1743,7 +1743,14 @@ udf_extattr_append_internal(union dscrptr *dscr, struct extattr_entry *extattr) extattrhdr = (struct extattrhdr_desc *) data; l_ea = udf_rw32(*l_eap); if (l_ea == 0) { +#if !defined(NDEBUG) && defined(__minix) assert(l_ad == 0); +#else + if (l_ad != 0) { + printf("%s:%d: l_ad != 0\n", __func__, __LINE__); + abort(); + } +#endif /* !defined(NDEBUG) && defined(__minix) */ /* create empty extended attribute header */ exthdr_len = sizeof(struct extattrhdr_desc); @@ -2157,6 +2164,10 @@ udf_create_new_rootdir(union dscrptr **dscr) struct long_ad root_icb; int filetype, error; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized when compiling with -O3 */ + fe = NULL; +#endif /*defined(__minix) */ memset(&root_icb, 0, sizeof(root_icb)); root_icb.len = udf_rw32(context.sector_size); root_icb.loc.lb_num = udf_rw32(layout.rootdir); diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 91e807527..c17b02c69 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -187,6 +187,10 @@ onecol(int argc, char *argv[]) int mor; int error = 1; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized, when compiling with -O3 */ + mor = 0; +#endif /* defined(__minix) */ if (nmwd) num = nmwd + 1; else diff --git a/usr.sbin/makefs/udf.c b/usr.sbin/makefs/udf.c index 8cc65742e..1ff612ff9 100644 --- a/usr.sbin/makefs/udf.c +++ b/usr.sbin/makefs/udf.c @@ -593,14 +593,28 @@ udf_file_inject_blob(union dscrptr *dscr, uint8_t *blob, off_t size) /* calculate free space */ free_space = context.sector_size - (l_ea + l_ad) - desc_size; if (udf_datablocks(size)) { +#if !defined(NDEBUG) && defined(__minix) assert(free_space < size); +#else + if (!(free_space < size)) { + printf("%s:%d not enough free space\n", __FILE__, __LINE__); + abort(); + } +#endif /* !defined(NDEBUG) && defined(__minix) */ return 1; } /* going internal */ assert(l_ad == 0); +#if !defined(NDEBUG) && defined(__minix) assert((udf_rw16(icb->flags) & UDF_ICB_TAG_FLAGS_ALLOC_MASK) == UDF_ICB_INTERN_ALLOC); +#else + if (!((udf_rw16(icb->flags) & UDF_ICB_TAG_FLAGS_ALLOC_MASK) == UDF_ICB_INTERN_ALLOC)) { + printf("%s:%d: allocation flags mismatch\n", __FILE__, __LINE__); + abort(); + } +#endif /* !defined(NDEBUG) && defined(__minix) */ // assert(free_space >= size); pos = data + l_ea + l_ad; @@ -690,7 +704,14 @@ udf_append_file_mapping(union dscrptr *dscr, struct long_ad *piece) last_long = NULL; if (l_ad != 0) { if (use_shorts) { +#if !defined(NDEBUG) && defined(__minix) assert(cur_alloc == UDF_ICB_SHORT_ALLOC); +#else + if (!(cur_alloc == UDF_ICB_SHORT_ALLOC)) { + printf("%s:%d: Expecting UDF_ICB_SHORT_ALLOC allocation\n", __FILE__, __LINE__); + abort(); + } +#endif /* !defined(NDEBUG) && defined(__minix) */ pos += l_ad - short_len; last_short = (struct short_ad *) pos; last_lb_num = udf_rw32(last_short->lb_num); @@ -698,7 +719,14 @@ udf_append_file_mapping(union dscrptr *dscr, struct long_ad *piece) last_len = UDF_EXT_LEN(udf_rw32(last_short->len)); last_flags = UDF_EXT_FLAGS(udf_rw32(last_short->len)); } else { +#if !defined(NDEBUG) && defined(__minix) assert(cur_alloc == UDF_ICB_LONG_ALLOC); +#else + if (!(cur_alloc == UDF_ICB_LONG_ALLOC)) { + printf("%s:%d: Expecting UDF_ICB_LONG_ALLOC allocation\n", __FILE__, __LINE__); + abort(); + } +#endif /* !defined(NDEBUG) && defined(__minix) */ pos += l_ad - long_len; last_long = (struct long_ad *) pos; last_lb_num = udf_rw32(last_long->loc.lb_num); diff --git a/usr.sbin/makefs/v7fs/v7fs_estimate.c b/usr.sbin/makefs/v7fs/v7fs_estimate.c index 74b7e25a6..3e09d47e1 100644 --- a/usr.sbin/makefs/v7fs/v7fs_estimate.c +++ b/usr.sbin/makefs/v7fs/v7fs_estimate.c @@ -132,6 +132,10 @@ estimate_size_walk(fsnode *root, char *dir, struct v7fs_geometry *geom) int n; off_t sz; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized, when compiling with -O3. */ + nblk = 0; +#endif /* defined(__minix) */ for (cur = root, nentries = 0; cur != NULL; cur = cur->next, nentries++, geom->ninode++) { switch (cur->type & S_IFMT) { @@ -257,6 +261,10 @@ v7fs_estimate(const char *dir, fsnode *root, fsinfo_t *fsopts) v7fs_daddr_t nblk; struct v7fs_geometry geom; +#if defined(__minix) + /* LSC: -Werror=maybe-uninitialized, when compiling with -O3. */ + nblk = 0; +#endif /* defined(__minix) */ memset(&geom , 0, sizeof(geom)); strncpy(path, dir, sizeof(path)); diff --git a/usr.sbin/syslogd/sign.c b/usr.sbin/syslogd/sign.c index 496d7644b..d6c90cd40 100644 --- a/usr.sbin/syslogd/sign.c +++ b/usr.sbin/syslogd/sign.c @@ -504,7 +504,11 @@ sign_send_certificate_block(struct signature_group_t *sg) char *tstamp; char payload[SIGN_MAX_PAYLOAD_LENGTH]; char sd[SIGN_MAX_SD_LENGTH]; +#if !defined(NDEBUG) && defined(__minix) size_t payload_len, sd_len, fragment_len; +#else + size_t payload_len, fragment_len; +#endif /* !defined(NDEBUG) && defined(__minix) */ size_t payload_index = 0; /* do nothing if CBs already sent or if there was no message in SG */ @@ -529,8 +533,11 @@ sign_send_certificate_block(struct signature_group_t *sg) else fragment_len = SIGN_MAX_FRAG_LENGTH; +#if !defined(NDEBUG) && defined(__minix) /* format SD */ - sd_len = snprintf(sd, sizeof(sd), "[ssign-cert " + sd_len = +#endif /* !defined(NDEBUG) && defined(__minix) */ + snprintf(sd, sizeof(sd), "[ssign-cert " "VER=\"%s\" RSID=\"%" PRIuFAST64 "\" SG=\"%d\" " "SPRI=\"%d\" TBPL=\"%zu\" INDEX=\"%zu\" " "FLEN=\"%zu\" FRAG=\"%.*s\" " diff --git a/usr.sbin/syslogd/tls.c b/usr.sbin/syslogd/tls.c index 65e5d22a4..f120497d8 100644 --- a/usr.sbin/syslogd/tls.c +++ b/usr.sbin/syslogd/tls.c @@ -56,6 +56,7 @@ __RCSID("$NetBSD: tls.c,v 1.11 2013/05/27 23:15:51 christos Exp $"); static unsigned getVerifySetting(const char *x509verifystring); +#if !defined(NDEBUG) && defined(__minix) /* to output SSL error codes */ static const char *SSL_ERRCODE[] = { "SSL_ERROR_NONE", @@ -80,6 +81,7 @@ static const char *TLS_CONN_STATES[] = { "ST_CLOSING0", "ST_CLOSING1", "ST_CLOSING2"}; +#endif /* !defined(NDEBUG) && defined(__minix) */ DH *get_dh1024(void); /* DH parameter precomputed with "openssl dhparam -C -2 1024" */