unsigned long GC_time_limit = GC_TIME_LIMIT;
#ifndef NO_CLOCK
- STATIC CLOCK_TYPE GC_start_time = 0;
+ STATIC CLOCK_TYPE GC_start_time = CLOCK_TYPE_INITIALIZER;
/* Time at which we stopped world. */
/* used only in GC_timeout_stop_func. */
#endif
GC_INNER GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
{
# ifndef SMALL_CONFIG
- CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
+ CLOCK_TYPE start_time = CLOCK_TYPE_INITIALIZER;
CLOCK_TYPE current_time;
# endif
ASSERT_CANCEL_DISABLED();
{
unsigned i;
# ifndef SMALL_CONFIG
- CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
+ CLOCK_TYPE start_time = CLOCK_TYPE_INITIALIZER;
CLOCK_TYPE current_time;
# endif
STATIC void GC_finish_collection(void)
{
# ifndef SMALL_CONFIG
- CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
- CLOCK_TYPE finalize_time = 0;
+ CLOCK_TYPE start_time = CLOCK_TYPE_INITIALIZER;
+ CLOCK_TYPE finalize_time = CLOCK_TYPE_INITIALIZER;
CLOCK_TYPE done_time;
# endif
# undef GET_TIME
# undef MS_TIME_DIFF
# define CLOCK_TYPE struct timeval
+# define CLOCK_TYPE_INITIALIZER { 0, 0 }
# define GET_TIME(x) { struct rusage rusage; \
getrusage (RUSAGE_SELF, &rusage); \
x = rusage.ru_utime; }
/* require -lm option for double-to-long conversion. */
#endif /* !BSD_TIME && !MSWIN32 */
+# ifndef CLOCK_TYPE_INITIALIZER
+ /* This is used to initialize CLOCK_TYPE variables (to some value) */
+ /* to avoid "variable might be uninitialized" compiler warnings. */
+# define CLOCK_TYPE_INITIALIZER 0
+# endif
+
/* We use bzero and bcopy internally. They may not be available. */
# if defined(SPARC) && defined(SUNOS4)
# define BCOPY_EXISTS
struct hblk ** rlp;
struct hblk ** rlh;
# ifndef SMALL_CONFIG
- CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
+ CLOCK_TYPE start_time = CLOCK_TYPE_INITIALIZER;
CLOCK_TYPE done_time;
if (GC_print_stats == VERBOSE)