Article View: comp.std.c
Article #3773Re: gets() and getchar
From: walter briscoe
Date: Fri, 18 Aug 1995 09:01
Date: Fri, 18 Aug 1995 09:01
35 lines
1801 bytes
1801 bytes
In article <danpop.808655822@rscernix> Dan.Pop@mail.cern.ch "Dan Pop" writes: > >I mentioned > > cc .... -Dgets=DONT_USE_GETS [snip] > Whether you include <stdio.h> or not is irrelevant. gets() is in the > implementation namespace, and any attempt to redefine it invokes undefined > behaviour, whether <stdio.h> is included or not: I have difficulty with any defence of gets because it allows a program to have undefined behavior at run time in consequence of an input. I think that is a standards issue and, in a perfect world, would argue that gets should be removed from the standard library. Given that, I appreciate any suggestion which assists me to avoid use of this abomination in my own code and to excise it from code for which I take responsibility. > This should end this thread in comp.std.c. Things which happen to work > on some implementations are better discussed elsewhere. > > Dan > -- > Dan Pop > CERN, CN Division > Email: Dan.Pop@mail.cern.ch > Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland > As indicated above, I disagree. The standard is not Holy Writ and deficiencies in it sometimes result in a need for hacking. -- walter briscoe
Technical Details
Message-ID:
<808736493snz@wbriscoe.demon.co.uk>Path:
arc1-ca.pugleaf.net!wbriscoe.demon.co.uk!walterReferences:
<Pine.ULT.3.91.950807194041.19202A-100000@mars> <409hdq$ib2@goanna.cs.rmit.edu.au> <KANZE.95Aug9103309@slsvhdt.lts.sel.alcatel.de> <40s0eo$k8c@goanna.cs.rmit.edu.au> <danpop.808655822@rscernix>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wbriscoe.demon.co.uk!walter From: walter briscoe <walter@wbriscoe.demon.co.uk> Newsgroups: comp.std.c Subject: Re: gets() and getchar Date: Fri, 18 Aug 95 09:01:33 GMT Message-ID: <808736493snz@wbriscoe.demon.co.uk> References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <409hdq$ib2@goanna.cs.rmit.edu.au> <KANZE.95Aug9103309@slsvhdt.lts.sel.alcatel.de> <40s0eo$k8c@goanna.cs.rmit.edu.au> <danpop.808655822@rscernix> Reply-To: walter@wbriscoe.demon.co.uk X-NNTP-Posting-Host: wbriscoe.demon.co.uk X-Newsreader: Demon Internet Simple News v1.29