Re: Why is it dangerous?
- From: Richard<rgrdev@xxxxxxxxx>
- Date: Sun, 10 Aug 2008 13:42:27 +0200
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
Julian said:
'evening.
I'm not new to C and have been programming in it since I was 8 but
here's a strange problem I've never seen before.
When I compile a program from our C course with a windows compiler
there is no problem but when I try to compile it with a linux compiler
it complains that
a_03.c:(.text+0x4d): warning: the `gets' function is dangerous
and should not be used.
Is linux more dangerous than windows?
No. Your Linux compiler warned you about a dangerous function that should
never be used.
Total and utter nonsense. C is used all over the place for creating
elements which are under strict control and the program/process/function
has a totally controlled and defined input stream. In those scenarios
gets is used flawlessly in millions of programs around the world.
if you can NOT define the input then I would agree. But in the real
world the input is indeed guarenteed in a properly functioning
system. if the system isn't well defined then all "bets are off" since
you can pretty much be sure that undefined behaviour/input has already
compromised the process pipeline.
.
- Follow-Ups:
- Re: Why is it dangerous?
- From: Edward A. Falk
- Re: Why is it dangerous?
- From: Nick Keighley
- Re: Why is it dangerous?
- From: santosh
- Re: Why is it dangerous?
- References:
- Why is it dangerous?
- From: Julian
- Re: Why is it dangerous?
- From: Richard Heathfield
- Why is it dangerous?
- Prev by Date: Re: Why is it dangerous?
- Next by Date: Re: how to find number of bytes freed
- Previous by thread: Re: Why is it dangerous?
- Next by thread: Re: Why is it dangerous?
- Index(es):
Relevant Pages
|