🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3871

Re: gets() and getchar

#3871
From: Clive D.W. Feather
Date: Sat, 26 Aug 1995 22:00
31 lines
1672 bytes
In article <41k6vv$ecd@goanna.cs.rmit.edu.au>,
Richard A. O'Keefe <ok@goanna.cs.rmit.edu.au> wrote:
> clive@stdc.demon.co.uk (Clive D.W. Feather) writes:
>>>>>    cc .... -Dgets=DONT_USE_GETS
>> You have missed the point. The Standard does not allow you to hide
>> gets in this way, as Dan points out.
> The standard is powerless to prevent it, because the form of expression
> in question is not written in C.  It's a Bourne shell, command!

In the original context, it was clear that this is another way of
inserting

    #define gets DONT_USE_GETS

at the start of the program. To this extent it is within the remit of
the Standard.

> The standard _doesn't_ say it is forbidden to do this,

It says that undefined behaviour results. Note that "not allow" is not
the same as "forbid".

> My claim is
[...]
true as far as it goes. So long as you remember:
> -- on THOSE implementations AT THE MOMENT (they could change tomorrow)

-- 
Clive D.W. Feather                       | If you lie to the compiler,
clive@demon.net        (work, preferred) | it will get its revenge.
clive@stdc.demon.co.uk (home)            |   - Henry Spencer
Technical Details
Message-ID: <DDxuG9.15E@stdc.demon.co.uk>
Path: arc1-ca.pugleaf.net!stdc.demon.co.uk!clive
References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <808736493snz@wbriscoe.demon.co.uk> <DDKuJq.84t@stdc.demon.co.uk> <41k6vv$ecd@goanna.cs.rmit.edu.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!stdc.demon.co.uk!clive
From: clive@stdc.demon.co.uk (Clive D.W. Feather)
Newsgroups: comp.std.c
Subject: Re: gets() and getchar
Date: Sat, 26 Aug 1995 22:00:07 GMT
Organization: Demon Internet Limited (personal account)
Message-ID: <DDxuG9.15E@stdc.demon.co.uk>
References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <808736493snz@wbriscoe.demon.co.uk> <DDKuJq.84t@stdc.demon.co.uk> <41k6vv$ecd@goanna.cs.rmit.edu.au>
Reply-To: clive@demon.net
X-NNTP-Posting-Host: stdc.demon.co.uk