Bug 41792 - Failed to compile the program includes ucontext.h without _BSD_SOURCE
Failed to compile the program includes ucontext.h without _BSD_SOURCE
Status: CLOSED DUPLICATE of bug 35968
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.1
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-22 01:08 EDT by Takanori Kawano
Modified: 2016-11-24 09:47 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-22 01:08:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Takanori Kawano 2001-05-22 01:08:43 EDT
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 03:09:49 EDT

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