From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1856 invoked by alias); 17 Feb 2003 15:06:21 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 1546 invoked from network); 17 Feb 2003 15:06:10 -0000 Received: from unknown (HELO gateway.sf.frob.com) (64.163.212.55) by 172.16.49.205 with SMTP; 17 Feb 2003 15:06:10 -0000 Received: from magilla.sf.frob.com (magilla.sf.frob.com [198.49.250.228]) by gateway.sf.frob.com (Postfix) with ESMTP id 0FCE3354C; Sun, 16 Feb 2003 20:41:03 -0800 (PST) Received: (from roland@localhost) by magilla.sf.frob.com (8.11.6/8.11.6) id h1H4f2529446; Sun, 16 Feb 2003 20:41:02 -0800 Date: Mon, 17 Feb 2003 15:06:00 -0000 Message-Id: <200302170441.h1H4f2529446@magilla.sf.frob.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Andreas Schwab Cc: libc-hacker@sources.redhat.com Subject: Re: Cyclic dependency between and In-Reply-To: Andreas Schwab's message of Friday, 14 February 2003 22:31:29 +0100 X-Antipastobozoticataclysm: When George Bush projectile vomits antipasto on the Japanese. X-SW-Source: 2003-02/txt/msg00038.txt.bz2 > There is a cyclic dependency between the headers and > when _XOPEN_SOURCE is defined to 500 or 600: > includes which includes which includes > . The effect is that you'll get a compiler error when > including due to ucontext_t begin undefined. I don't > know how to fix that properly, a workaround is to include > instead. For the record, this is easily reproduced by: echo '#include ' | gcc -c -x c - -D_XOPEN_SOURCE=600 Moving #include outside of #ifndef _SYS_UCONTEXT_H gets around this. That way, it winds up getting the definitions it needs at the first inclusion depth, and then the circularity back to does the definitions needs, leaving nothing left in the outermost inclusion depth (_SYS_UCONTEXT_H is already defined). I believe in is only because is supposed to define the ucontext_t and mcontext_t types. 1003.1-2001 doesn't say it should declare makecontext et al as well. That being the case, can just include instead of and we won't have this problem (or the unrequested declarations of makecontext et al). The following patch does that, and makes the test case compile ok for me. 2003-02-16 Roland McGrath * signal/signal.h: Include , not . --- signal/signal.h.~1.66.~ Wed Oct 23 14:05:37 2002 +++ signal/signal.h Sun Feb 16 20:40:19 2003 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999,2000,2001,2002,2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -327,7 +327,8 @@ extern int siginterrupt (int __sig, int # include # ifdef __USE_XOPEN -# include +/* This will define `ucontext_t' and `mcontext_t'. */ +# include # endif /* Run signals handlers on the stack specified by SS (if not NULL).