Also fixes ARM assert build -O3.
Change-Id: I52bda91308ecfa0e8b23c4140c38c49347cc10f7
*/
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 */
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
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
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: "
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);
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);
}
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)
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) */
}
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);
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;
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";
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;
assert(np);
assert(MDOC_BLOCK == np->type);
assert(MDOC_Bl == np->tok);
+#endif /* !defined(NDEBUG) && defined(__minix) */
return(1);
}
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;
assert(np);
assert(MDOC_BLOCK == np->type);
assert(MDOC_Bd == np->tok);
+#endif /* !defined(NDEBUG) && defined(__minix) */
return(1);
}
{
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.
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;
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;
int procnum;
int uid;
+#if defined(__minix)
+ /* LSC: -Werror=maybe-uninitialized while compiling with -O3. */
+ prio = 0;
+#endif /* defined(__minix) */
ERR_RESET;
uid = getuid();
** 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 ){
for(iRead=0; iRead<pTab->nColumn; 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. */
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);
{
message msg;
int res;
- size_t grant_size;
+ size_t grant_size = 0;
void *buf = serialize_dev(dev, &grant_size);
if (buf == NULL)
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);
}
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");
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;
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);
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,
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);
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);
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
/* 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;
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);
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);
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) {
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));
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 */
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\" "
static unsigned getVerifySetting(const char *x509verifystring);
+#if !defined(NDEBUG) && defined(__minix)
/* to output SSL error codes */
static const char *SSL_ERRCODE[] = {
"SSL_ERROR_NONE",
"ST_CLOSING0",
"ST_CLOSING1",
"ST_CLOSING2"};
+#endif /* !defined(NDEBUG) && defined(__minix) */
DH *get_dh1024(void);
/* DH parameter precomputed with "openssl dhparam -C -2 1024" */