From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Gould To: gcc-gnats@gcc.gnu.org Cc: gildea@intouchsys.com Subject: c/3297: fixincludes (?) removes pthread types from types.h Date: Wed, 20 Jun 2001 08:46:00 -0000 Message-id: <200106201539.f5KFdtg18503@curley.intouchsys.com> X-SW-Source: 2001-06/msg00834.html List-Id: >Number: 3297 >Category: c >Synopsis: fixincludes (?) removes pthread types from types.h >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Jun 20 08:46:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Grant Gould >Release: 3.0 >Organization: Comverse Network Systems (Voice Solutions) >Environment: System: SunOS curley.intouchsys.com 5.7 Generic_106541-15 sun4m sparc SUNW,SPARCstation-5 Architecture: sun4 host: sparc-sun-solaris2.5 build: sparc-sun-solaris2.5 target: sparc-sun-solaris2.5 configured with: ../gcc-3.0/configure >Description: /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/3.0/include/sys/types.h does not define pthreads-related types. Standard solaris headers in /usr/include (such as /usr/include/time.h) rely on it doing so. This results in parse errors when these headers use pthread_attr_t and it has not been provided by the #include >How-To-Repeat: Here's a copy-and-paste of my demonstration. Note that hworld2.c is legal, but will only compile if I explicitly force the use of the headers in /usr/include rather than letting gcc use its fixed headers. $ curley $ cat hworld.c #include int main(int argc, char **argv) { printf("Hello, World!\n"); } $ curley $ cat hworld2.c #include #include int main(int argc, char **argv) { printf("Hello, World!\n"); } $ curley $ gcc hworld.c -o hworld $ curley $ ./hworld Hello, World! $ curley $ gcc hworld2.c -o hworld2 In file included from hworld2.c:1: /usr/include/time.h:131: parse error before "pthread_attr_t" /usr/include/time.h:133: parse error before '}' token $ curley $ gcc hworld2.c -I/usr/include/ -o hworld2 $ curley $ ./hworld2 Hello, World! >Fix: Well, you could leave the pthreads definitions in the fixed types.h -- I don't see why it is excised. As it is, gcc leaves a situation where no simple #include line will get you the pthread types. That's no good. >Release-Note: >Audit-Trail: >Unformatted: