TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Clem Clarke
from: Michael Stapleton
date: 1993-08-26 23:49:00
subject: Re: hang from scanf()

Hello Clem,
I noticed you and David Nugent and Paul Edwards,discussing pointers going
out of bounds.
 CC> Precisely.  This is my biggest beef with C.  I have spent days looking
 CC> for this type of problem sometimes.  Impossible (?) to happen in any
 CC> other high level language, eg Pascal, Cobol, PL/I, 370 Assm etc.
  You call Cobol high-level ?  :-) Seriously though, C is letting you 'work
without a net' with pointers.  This is its greatest power & its greatest
danger.  Without this aspect, C would be bulkier & not so useful for
writing the operating system in.

 dn> It has not been my experience that this particular type of problem is
 dn> related to the language in use. There is no logical reason why it
 dn> should be, either.

CC> Oh David, if *only* you were right!
  I wonder how many languages & environments David has studied or
programmed in ...

CC> I think there is a logical reason why it is much more difficult to
CC> destry
CC> variables on the stack in other languages.  Basically, Pascal, PL/I,
CC> 370 Assembler etc etc, all truncate strings when they will overflow
CC> their destinations.
  Yes, if C's untamed pointers are too dangerous, use Pascal.  Pascal is
great when you want a bullet proof program that your teacher would be proud
of.
  I've never used a 370, but IBM donated a 360/20 to the Museum of Applied
Arts & Sciences (the ancestor of the PowerHouse Museum) in the early 70s.
On this machine I got my first hands-on programming experience, first in
PL/I (well PL/0 really) then a little bit of 360/370 Assembler.  Your
examples were like a postcard from 20 years ago.  Thanks!
 BTW, what's PL/I like these days?  I've heard it is so large that there
has never been a complete implementation of it!  Is there a useful micro
version?
  When I first started using C in 1980 I found its approach to pointers a
little too free, I was used to a bit more built-in protection & isolation
from the nitty-gritty details of addressing. Now I just take it as part of
the environment. It's like living on a cliff: the view is great, but it can
be dangerous. :-)
Michael Stapleton of Graphic Bits.

___I'm only here for the taglines.

--- Blue Wave/RA v0.7 Q-Blue

* Origin: The Three Amigas - better than two (3:713/615.0)
SEEN-BY: 54/54 99 711/401 430 807 808 809 932 934 712/627 713/111 317 601 611
SEEN-BY: 713/615 618 700 729 805 888 906 714/906
@PATH: 713/615 888 54/99 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.