Bug 59401 - <pthread.h> cannot declare pthread_rwlock_t
Summary: <pthread.h> cannot declare pthread_rwlock_t
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-07 02:11 UTC by Eric Fallon
Modified: 2016-11-24 14:56 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-02-07 02:13:45 UTC
Embargoed:


Attachments (Terms of Use)
Very short program used to produce error. (838 bytes, text/plain)
2002-02-07 02:13 UTC, Eric Fallon
no flags Details

Description Eric Fallon 2002-02-07 02:11:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
When attempting to compile a program declaring pthread_rwlock_t from <pthread.h>
gcc will issue an error and fail.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Obtain the program simple.c
2.  Invoke gcc -c simple.c
	

Actual Results:  Upon compilation gcc will issue the following error messages:

simple.c:16: parse error before 'rwlock'
simple.c:16: warning: data definition has no type or storage class

Expected Results:  gcc should allow you to declare this type.

Without being able to declare this type you will not be able to utalize any of
the rwlock methods included in <pthread.h> as they all utalize a variable of
type pthread_rwlock_t.

Additional info:

I am using glibc version 2.2.4-19.3.

This program will compile without error on Solaris.

Comment 1 Eric Fallon 2002-02-07 02:13:40 UTC
Created attachment 44798 [details]
Very short program used to produce error.

Comment 2 Jakub Jelinek 2002-02-07 10:19:29 UTC
pthread_rwlock_t is only available in Unix98 and later standards.
So, you need to choose such feature set if you want to use it.
One of -D_XOPEN_SOURCE=500, -D_XOPEN_SOURCE=600 or -D_GNU_SOURCE will do.
See info libc on "Feature Test Macros".


Note You need to log in before you can comment on or make changes to this bug.