From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28284 invoked by alias); 12 Jan 2010 11:01:07 -0000 Received: (qmail 28242 invoked by uid 22791); 12 Jan 2010 11:01:06 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jan 2010 11:01:02 +0000 Received: from sunsite.mff.cuni.cz (localhost [127.0.0.1]) by sunsite.mff.cuni.cz (8.14.3/8.14.3) with ESMTP id o0CB0hCh008029; Tue, 12 Jan 2010 12:00:43 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.14.3/8.14.3/Submit) id o0CB0hT6008028; Tue, 12 Jan 2010 12:00:43 +0100 Date: Tue, 12 Jan 2010 11:01:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: Re: [PATCH] Fix sys/wait.h Message-ID: <20100112110042.GI2855@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: <20100112105013.GH2855@sunsite.ms.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100112105013.GH2855@sunsite.ms.mff.cuni.cz> User-Agent: Mutt/1.5.19 (2009-01-05) Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00002.txt.bz2 On Tue, Jan 12, 2010 at 11:50:13AM +0100, Jakub Jelinek wrote: > #define _POSIX_C_SOURCE 200809L > #include > #include > > now fails to compile. The following should fix it. Small correction to the testcase, the problem is without any feature test macros actually. In file included from a.c:2: /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:80, from a.c:2: /usr/include/bits/waitstatus.h:68: error: redefinition of ‘union wait’ The posted patch fixes it. > 2010-01-12 Jakub Jelinek > > * posix/sys/wait.h: Don't define W* macros etc. if > stdlib.h has been included with _POSIX_C_SOURCE >= 200809L. > > diff --git a/posix/sys/wait.h b/posix/sys/wait.h > index bb98c00..6d7f068 100644 > --- a/posix/sys/wait.h > +++ b/posix/sys/wait.h > @@ -32,7 +32,7 @@ __BEGIN_DECLS > #include > > /* These macros could also be defined in . */ > -#if !defined _STDLIB_H || !defined __USE_XOPEN > +#if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) > /* This will define the `W*' macros for the flag > bits to `waitpid', `wait3', and `wait4'. */ > # include Jakub