This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]