This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch} fix call to time() in toplev.c
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: nathan at codesourcery dot com
- Date: Tue, 8 Jul 2003 11:04:01 +1000 (EST)
- Subject: [Patch} fix call to time() in toplev.c
Hello.
The call to time() in toplev.c (randomize) breaks build on systems without
gettimeofday. The ANSI prototype for function time is;
time_t time (time_t);
This fixes:
2003-07-08 Danny Smith <dannysmith@users.sourceforge.net>
* toplev.c (randomize): Correct call to time().
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.799
diff -c -3 -p -r1.799 toplev.c
*** toplev.c 7 Jul 2003 11:12:27 -0000 1.799
--- toplev.c 8 Jul 2003 00:55:45 -0000
*************** randomize (void)
*** 1589,1595 ****
}
#else
{
! time_t now = time ();
if (now != (time_t)-1)
local_tick = (unsigned) now;
--- 1589,1595 ----
}
#else
{
! time_t now = time (NULL);
if (now != (time_t)-1)
local_tick = (unsigned) now;
This fix
http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.