Bug 8444

Summary: <stdio.h> missing prototypes with -DPOSIX_C_SOURCE=199506
Product: [Retired] Red Hat Linux Reporter: Jay Turner <jturner>
Component: glibcAssignee: Cristian Gafton <gafton>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2CC: fweimer, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-14 20:38: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 Glen Foster 2000-01-13 15:14:08 UTC
VSX-PCTS finds a problem with <stdio.h> - similar to defect #8443.  The
test expects to see definitions for "stdin", "stdout", and "stderr" when
#including <stdio.h> and compiling with the following 2 option sets:

	(a) -DPOSIX_C_SOURCE=199506
	(b) -DPOSIX_C_SOURCE=199506 -DPOSIX_SOURCE

Appropriate lines from testing journal are as follows:
======================================================================
200|5 4 17:56:47|TP Start
520|5 4 00006063 4 1|Feature test macros: -D_POSIX_C_SOURCE=199506
520|5 4 00006063 4 2|Compiler or run-time messages or results:
520|5 4 00006063 4 3|Undefined identifier: stdin
520|5 4 00006063 4 4|Undefined identifier: stdout
520|5 4 00006063 4 5|Undefined identifier: stderr
520|5 4 00006063 7 1|Feature test macros: -D_POSIX_C_SOURCE=199506
-D_POSIX_SOURCE
520|5 4 00006063 7 2|Compiler or run-time messages or results:
520|5 4 00006063 7 3|Undefined identifier: stdin
520|5 4 00006063 7 4|Undefined identifier: stdout
520|5 4 00006063 7 5|Undefined identifier: stderr

Comment 1 Cristian Gafton 2000-01-14 20:38:59 UTC
probably teh test suite expects to see themm defined as constants, but there is
no standard requiring that.

Anyway, this works ofr me also:

alien (gafton):~/src/glibc/proto>cat proto.c
#define POSIX_C_SOURCE 199506
#include <stdio.h>

alien (gafton):~/src/glibc/proto>gcc -E proto.c -c | \
	grep "stdin\|stderr\|stdout"
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;