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)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  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:
Last Closed: 2001-05-22 01:08:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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. 

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

#define _BSD_SOURCE
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 

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

 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED

How reproducible:

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

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.