Bug 555060 - stdlib.h and sys/wait.h error: conflicting types for ‘__WAIT_STATUS’
Summary: stdlib.h and sys/wait.h error: conflicting types for ‘__WAIT_STATUS’
Keywords:
Status: CLOSED DUPLICATE of bug 554643
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-13 15:00 UTC by Mark Wielaard
Modified: 2010-01-13 15:04 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-01-13 15:04:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mark Wielaard 2010-01-13 15:00:11 UTC
Description of problem:

Including stdlib.h and sys/wait.h in the "wrong" order produces conflicting types.

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

glibc-headers-2.11.90-7.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. $ cat t.c 
#include <stdlib.h>
#include <sys/wait.h>

2. gcc -c t.c
  
Actual results:

In file included from t.c:3:
/usr/include/sys/wait.h:67: error: conflicting types for ‘__WAIT_STATUS’
/usr/include/stdlib.h:72: note: previous declaration of ‘__WAIT_STATUS’ was here
In file included from /usr/include/sys/wait.h:81,
                 from t.c:3:
/usr/include/bits/waitstatus.h:68: error: redefinition of ‘union wait’

Expected results:

t.c being compiled.

Additional info:

Switching the order of the includes to read:

#include <sys/wait.h>
#include <stdlib.h>

makes things compile as workaround.
But I don't believe order should matter here.

Comment 1 Andreas Schwab 2010-01-13 15:04:10 UTC

*** This bug has been marked as a duplicate of bug 554643 ***


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