*BSD News Article 18906


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!uunet!emba-news.uvm.edu!wollman
From: wollman@UVM.EDU (Garrett Wollman)
Subject: Re: Using gets() [ Was Re: nn ]
Message-ID: <1993Jul26.215124.22345@emba.uvm.edu>
Sender: news@emba.uvm.edu
Organization: University of Vermont, EMBA Computer Facility
References: <CAKu2r.10rt@austin.ibm.com> <CAq222.8E4@sugar.NeoSoft.COM> <22u6tmINN2t6@xs4all.hacktic.nl> <CAsEpH.55o@sugar.neosoft.com>
Date: Mon, 26 Jul 1993 21:51:24 GMT
Lines: 35

In article <CAsEpH.55o@sugar.neosoft.com>,
Peter da Silva <peter@NeoSoft.com> wrote:

(Hey, the new version of Trn automatically folds lines...)

>Not entirely. I think gets() should be made non-functional unless you
>make an explicit choice to pull it in. I just think that this breakage
>should occur at compile time, not run time.

If we eventually upgrade to the new GNU ld program, there is a .stabs
directive that can be used to make the linker emit an error when
linking a program that references a specific symbol.  (Obviously Chris
could not depend on this for his portable stdio, but it's a reasonable
accomodation to make.)

I don't think that this treatment should be made for other functions
than gets(), although getwd() is another prime target.  For example,
think of what would happen if the same behavior were used for
sprintf().  (``This program uses sprintf(), which is unsafe.  Please
bug its maintainer to use snprintf() instead.'')  strtok(), while
stateful and ugly and all that, is not actively dangerous to use, at
least not until we have threads.

One of the nice features of putting these routines in a separate
library would be that programs such as metaconfig and autoconf would
generate scripts that would not find these routines, and configure the
programs not to use them.

-GAWollman

-- 
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@emba.uvm.edu | Shashish is the bonding of hearts in spite of distance.
uvm-gen!wollman      | It is a bond more powerful than absence.  We like people
UVM disagrees.       | who like Shashish.  - Claude McKenzie + Florent Vollant