🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2108

FILE *yyin=stdin; not ANSI-C??

#2108
From: Emmerik P.J.L. van
Date: Thu, 08 Oct 1992 22:08
36 lines
1533 bytes
The following looks to me perfectly legal ANSI-C code.

sgi-cad> cat test.c
# include <stdio.h>
FILE *yyin = {stdin}, *yyout = {stdout};
main()
{
}

Nevertheless i get the following results when compiling on a
Silicon Graphics workstation:

sgi-cad> cc -cckr test.c
sgi-cad> cc -ansi test.c
accom: Error: test.c, line 2: integer constant expected
       FILE *yyin = {   (__stdin) }, *yyout = { (__stdout) };
       ---------------------------^
sgi-cad> cc -xansi test.c
sgi-cad> cc -ansiposix test.c
accom: Error: test.c, line 2: integer constant expected
       FILE *yyin = {   (__stdin) }, *yyout = { (__stdout) };
       ---------------------------^

Who is wrong, me or the SGI C-compiler?
If i am wrong, how do i initialize a FILE pointer to point to
standard input/output.

I am working with version 4.0.1 of the IRIS operating system.

Pleace Email to emmerik@utwente.nl

-- 
Pieter van Emmerik                    | Phone:  +31-74-464231
HDS info management                   | FAX:    +31-74-464110
P.O.box 23                            | E-mail: emmerik@utwente.nl
7550 AA  Hengelo, The Netherlands     |         hp4nl!utrcu1!emmerik
Technical Details
Message-ID: <1992Oct8.220811.7882@utwente.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!utrcu1!emmerik

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!utrcu1!emmerik
From: emmerik@utrcu1.civ.utwente.nl (Emmerik P.J.L. van)
Subject: FILE *yyin=stdin; not ANSI-C??
Message-ID: <1992Oct8.220811.7882@utwente.nl>
Sender: emmerik@utwente.nl (Emmerik P.J.L. van)
Organization: University of Twente
Date: Thu, 8 Oct 1992 22:08:11 GMT
Lines: 36