🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9549

stdio - is it really standard?

#9549
From: Robert Vaughan
Date: Fri, 10 Oct 1986 23:25
31 lines
2133 bytes
About a month ago I posted a response for someone, telling them how
to use scanf to read in double precision floating point (e.g.
scanf("%lf",&foo) where foo is declared as a double). This caused
a small round of debate about how various C implementations use
%lf, %Lf, etc. in their scanf's.

In the original K&R, it seems to me that their was no claim that
the functions described under stdio library would indeed be the
same across all machines. Let's not forget that stdio *is* just a
collection of C functions, written in C (that's part of what makes C
so nice - it has a small core syntax compared to Pascal and gargantua languages
such as PL/1...). In a bind, any good C programmer could write his own
stdio (yeech! what a horrible thought).

Now for a question: what is the status of stdio in the ANSI C definition?
Since programming C without stdio is like a day without sunshine (or
a day with lots of smog, here in LA :-)), I assume that ANSI has done some
work to firm up the various definitions of the functions in stdio. A short
answer would be best, since all of us can order up the ANSI draft to get
the details. Obviously, the answer also involves the data types allowed 
in ANSI C.

A related question involves the math libraries for things like
transcendental functions. Is sin() a now a valid ANSI C function/keyword?
Can I use the variable names sin and cos in my program if I don't
link the math library? 

Curiouser and curiouser...
Robert E. Vaughan
TRW Electronics Systems Group
{ !ucbvax!trwrb!orion!vaughan  is the only path I know... }
Technical Details
Message-ID: <25@orion.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!nike!ucbcad!ucbvax!hplabs!sdcrdcf!trwrb!orion!vaughan

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!nike!ucbcad!ucbvax!hplabs!sdcrdcf!trwrb!orion!vaughan
From: vaughan@orion.UUCP (Robert Vaughan)
Newsgroups: net.lang.c
Subject: stdio - is it really standard?
Message-ID: <25@orion.UUCP>
Date: Fri, 10-Oct-86 19:25:02 EDT
Article-I.D.: orion.25
Posted: Fri Oct 10 19:25:02 1986
Date-Received: Sat, 11-Oct-86 21:48:23 EDT
Organization: TRW Digital Development Laboratory, Manhattan Beach, CA
Lines: 31
Keywords: stdio, standard C, scanf