Bug 41792 - Failed to compile the program includes ucontext.h without _BSD_SOURCE
Summary: Failed to compile the program includes ucontext.h without _BSD_SOURCE
Status: CLOSED DUPLICATE of bug 35968
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc   
(Show other bugs)
Version: 7.1
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-05-22 05:08 UTC by Takanori Kawano
Modified: 2016-11-24 14:47 UTC (History)
1 user (show)

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: ---


Attachments (Terms of Use)

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 ***


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