Bug 13029

Summary: Subject: regex.h should include sys/types.h
Product: Base System Reporter: dgilbert <dgilbert>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-RELEASE   
Hardware: Any   
OS: Any   

Description dgilbert 1999-08-08 16:50:00 UTC
	programs that include regex.h without including sys/types.h fail
to compile

Fix: 

workaround: include sys/types.h first.
How-To-Repeat: 
	The current version of siag is an example.
Comment 1 Garrett A. Wollman 1999-08-08 17:04:31 UTC
<<On Sun, 8 Aug 1999 11:41:43 -0400 (EDT), David Gilbert <dgilbert@velocet.ca> said:

> 	programs that include regex.h without including sys/types.h fail
> to compile

<sys/types.h> is a documented prerequisite of <regex.h>, sanctioned by
P1003.2.

-GAWollman
Comment 2 Martin Cracauer 1999-08-10 14:36:10 UTC
In <owner-freebsd-bugsATFreeBSD.ORG--199908081541.LAA61376@strike.velocet.ca>, David Gilbert wrote: 
> 
> >Number:         13029
> >Category:       bin
> >Synopsis:       Subject: regex.h should include sys/types.h

As stated in the man page, you have to include sys/types by yourself
before regex.h

A reason why this such things are done is that sys/types narrows down
the choice of identifiers you may use in your program. For each header
file, there's a list of reserved identifies. If you include
sys/types.h by yourself, you will know that you have to avoid them. If
some other header file with a different reserved identifier list
silently includes a file with other reservations, the user don't
recognize.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@bik-gmbh.de> http://www.bik-gmbh.de/~cracauer/
"Where do you want to do today?" Hard to tell running your calendar 
 program on a junk operating system, eh?
Comment 3 Nick Hibma freebsd_committer freebsd_triage 1999-08-11 10:27:25 UTC
State Changed
From-To: open->closed

Good reason why including types.h is a bad thing is given.