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]

RFA: Patch for getrusage compile failure i timevar.c:get_time on e.g. libc1 systems


On this i686-pc-linux-gnulibc1 system, I'm getting:

gcc -c  -DIN_GCC   -DUSE_GNULIBC_1 -g  -W -Wall -Wtraditional -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  -DHAVE_CONFIG_H    -I. -I/home/hp/egcs/cvs_write/egcs/gcc -I/home/hp/egcs/cvs_write/egcs/gcc/config -I/home/hp/egcs/cvs_write/egcs/gcc/../include /home/hp/egcs/cvs_write/egcs/gcc/timevar.c
/home/hp/egcs/cvs_write/egcs/gcc/timevar.c: In function `get_time':
/home/hp/egcs/cvs_write/egcs/gcc/timevar.c:159: storage size of `rusage' isn't known
/home/hp/egcs/cvs_write/egcs/gcc/timevar.c:160: warning: implicit declaration of function `getrusage'
/home/hp/egcs/cvs_write/egcs/gcc/timevar.c:159: warning: unused variable `rusage'

Looks to me like missing config portability bits.

Bootstrapped (with forthcoming fixinclude patch) on
i686-pc-linux-gnulibc1, languages=c,c++.

Ok to commit?

2000-07-04  Hans-Peter Nilsson  <hp@axis.com>

	* timevar.c [HAVE_SYS_RESOURCE_H]: Include <sys/resource.h>.
	[NEED_DECLARATION_GETRUSAGE]: Declare getrusage.

Index: timevar.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/timevar.c,v
retrieving revision 1.8
diff -p -c -r1.8 timevar.c
*** timevar.c	2000/06/29 17:31:03	1.8
--- timevar.c	2000/07/04 13:18:00
***************
*** 27,32 ****
--- 27,39 ----
  # include <sys/times.h>
  #endif
  
+ #ifdef HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #ifdef NEED_DECLARATION_GETRUSAGE
+ extern int getrusage PARAMS ((int, struct rusage *));
+ #endif
+ 
  #include "flags.h"
  #include "timevar.h"
  
brgds, H-P

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