From: Erik van der Kouwe Date: Thu, 17 Dec 2009 08:43:31 +0000 (+0000) Subject: Remove some GCC library warnings X-Git-Tag: v3.1.6~149 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/cppcheck-error.log?a=commitdiff_plain;h=ac900e59ba5d8ee8337a584ccf084b31df3e8311;p=minix.git Remove some GCC library warnings --- diff --git a/lib/ansi/abort.c b/lib/ansi/abort.c index 8013b69cf..454d0e66c 100644 --- a/lib/ansi/abort.c +++ b/lib/ansi/abort.c @@ -17,6 +17,7 @@ abort(void) { if (_clean) _clean(); /* flush all output files */ raise(SIGABRT); + exit(-1); /* NORETURN */ } diff --git a/lib/other/settimeofday.c b/lib/other/settimeofday.c index 956135a38..eed953bab 100644 --- a/lib/other/settimeofday.c +++ b/lib/other/settimeofday.c @@ -9,6 +9,9 @@ settimeofday.c int settimeofday(const struct timeval *tp, const void *tzp) { + /* Use intermediate variable because stime param is not const */ + time_t sec = tp->tv_sec; + /* Ignore time zones */ - return stime(&tp->tv_sec); + return stime(&sec); } diff --git a/lib/sysutil/profile.c b/lib/sysutil/profile.c index e8523080a..beb16b269 100644 --- a/lib/sysutil/profile.c +++ b/lib/sysutil/profile.c @@ -22,7 +22,7 @@ PRIVATE char cpath[CPROF_CPATH_MAX_LEN]; /* current call path string */ PRIVATE int cpath_len; /* current call path len */ PRIVATE struct cprof_tbl_s *cprof_slot; /* slot of current function */ -PRIVATE struct stack_s { /* stack entry */ +struct stack_s { /* stack entry */ int cpath_len; /* call path len */ struct cprof_tbl_s *slot; /* table slot */ u64_t start_1; /* count @ begin of procentry */