but doesn't #include it
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Jason R. Thorpe <thorpej@mail.CS.ORST.EDU>
List: netbsd-bugs
Date: 10/06/1994 22:05:03
>Number: 508
>Category: misc
>Synopsis: <sys/resource.h> requires <sys/types.h> but doesn't #include it
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: gnats-admin (Misc Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 6 22:05:02 1994
>Originator: Jason R. Thorpe
>Organization:
--------------------------------------------------------------------------
Jason R. Thorpe thorpej@cs.orst.edu 758-2003
Systems Administrator CSWest Room 5 737-2229
CS Dept, Oregon State University http://www.cs.orst.edu/~thorpej
"I brought my BOWLING BALL -- and some DRUGS!"
-- ztp
>Release: NetBSD 1.0_BETA (sup'd ~2.5 weeks ago)
>Environment:
System: NetBSD helix 1.0_BETA NetBSD 1.0_BETA (HELIX) #24: Thu Sep 15 23:17:39 PDT 1994 thorpej@helix:/usr/src/sys/arch/hp300/compile/HELIX hp300
>Description:
<sys/resource.h> used quad_t, which is typedef'd in <sys/types.h>,
yet does not #include <sys/types.h>, but instead relies on the
prgrammer to #include it first, which won't happen when following
a coding style that requires sys includes first in alpha-order,
and then other includes in alpha-order.
>How-To-Repeat:
Try to compile something like Dhrystone 2.1...You'll see:
cc -DUNIX -DROPT -O6 -O -c timers_b.c
In file included from timers_b.c:79:
/usr/include/sys/resource.h:102: parse error before `quad_t'
/usr/include/sys/resource.h:102: warning: no semicolon at end of struct or union
/usr/include/sys/resource.h:103: warning: data definition has no type or storage class
/usr/include/sys/resource.h:108: parse error before `fixpt_t'
/usr/include/sys/resource.h:108: warning: no semicolon at end of struct or union
/usr/include/sys/resource.h:110: parse error before `}'
*** Error code 1
Stop.
Stop.
>Fix:
#include <sys/types.h> in <sys/resource.h>
Here's a patch:
*** resource.h.orig Thu Oct 6 21:47:45 1994
--- resource.h Thu Oct 6 21:47:50 1994
***************
*** 38,43 ****
--- 38,45 ----
#ifndef _SYS_RESOURCE_H_
#define _SYS_RESOURCE_H_
+ #include <sys/types.h>
+
/*
* Process priority specifications to get/setpriority.
*/
>Audit-Trail:
>Unformatted: