Bug 41792

Summary: Failed to compile the program includes ucontext.h without _BSD_SOURCE
Product: [Retired] Red Hat Linux Reporter: Takanori Kawano <t-kawano>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-22 05:08:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Takanori Kawano 2001-05-22 05:08:43 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)

Description of problem:
I failed to compile 1) while I could compile 2) successfully. 

1)
---test1.c----
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED
#include<ucontext.h>
main() {}
--------------

# gcc test1.c
In file included from /usr/include/ucontext.h:28,
                 from test.c:6:
/usr/include/sys/ucontext.h:46: field `_mc' has incomplete type
/usr/include/sys/ucontext.h:49: dereferencing pointer to incomplete type
/usr/include/sys/ucontext.h:49: size of array `_pad' has non-integer type
gcc: Internal compiler error: program cc1 got fatal signal 11


2)
---test2.c----
#define _BSD_SOURCE
#include<ucontext.h>
main() {}
--------------

I think the cause is in /usr/include/signal.h.
In signal.h, if __USE_XOPEN_EXTENDED was defined the valuable of 
mcontext_t type is used but the type is not defined without __USE_BSD.
 
I suppose /usr/include/signal.h should be applied a patch like the 
following.

--- signal.h    Tue May 22 11:46:26 2001
+++ /usr/include/signal.h.modified      Tue May 22 11:47:35 2001
@@ -311,6 +311,9 @@

 #endif /*  use BSD.  */

+#if !defined __USE_BSD && defined __USE_XOPEN_EXTENDED
+# include <bits/sigcontext.h>
+#endif

 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED


How reproducible:
Always

Steps to Reproduce:
1.gcc -c test1.c
2.gcc -c test2.c
3.
	

Additional info:

Comment 1 Bill Nottingham 2001-05-22 07:09:49 UTC

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