Bug 3137
Summary: | FILE *stdin, *stdout, *stderr are not constant in stdio.h | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Damien, Miller <dmiller> |
Component: | glibc | Assignee: | Cristian Gafton <gafton> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0 | CC: | brownt, rshapiro |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 1999-05-29 13:59:05 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
Damien, Miller
1999-05-29 03:49:58 UTC
Yes, glibc-2.1 requires programs to be re-written as below. Some of the internals of the stdio structures have changed making compatibility with glibc-2.0 more problematic than it would be otherwise. The change below permits the loader to fix certain of these problems and prevents the situation from happening again. (At least I think that's the correct explanation ...) #include <stdio.h> FILE *logf; int main(void) { logf = stderr; fprintf(logf, "This bites.\n"); } *** Bug 3253 has been marked as a duplicate of this bug. *** In glibc-devel-2.1.1-6 a gratuitous change to stdio.h/libio.h was made which prevents stdin, stderr and stdout from being used as initializers. The code below complies on every system I've tried *except* the latest glibc-devel-2.1.1. #include <stdio.h> FILE *x = stdout; An (unnacceptable) workaround is to use _IO_stdout. *** Bug 3742 has been marked as a duplicate of this bug. *** The change of stderr in the standard include file /usr/include/stdio.h from #define stderr _IO_stderr in Redhat 5.2 to: extern FILE *stderr in Rh 6.0 may cause problems in older programs that expect the normal definition for stderr. |