Re: Why is it dangerous?



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.


.



Relevant Pages

  • Re: [EGN] Numerical Accuracy
    ... The advice worked because in fact the Microsoft compiler had a bug. ... The capabilities of the optimizer are not so ... The language standard itself says ... of "programming" as a nonprofession. ...
    (comp.programming)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... and just hone in on the stuff related to programming and this newsroup] ... moron that was taken from optimization which does hoist when to do so ... compiler design and optimization, including my 1976 text in graduate ... loop in a language in which the designers messed up, ...
    (comp.programming)
  • Re: Javas performance far better that optimized C++
    ... The compiler is extremely stupid. ... no memory leaks are guaranteed. ... However I have GC in my .NET programming. ... "C.9.1 Automatic Garbage Collection ...
    (comp.lang.cpp)
  • Re: Multi Threading Options
    ... An idea I tried was to build in an object-based file system back around 1977. ... and had no interest at all in the underlying byte stream sent to a compiler. ... something seriously missing in modern programming environments. ... but in a truly modern programming environment these would ...
    (microsoft.public.vc.mfc)
  • Re: Aspiring highest-order programmer
    ... book", Sherman's Programming and Coding for Digital Computers, was ... an IBM 7094 running IBSYS as an OS and with a Fortran compiler. ... Thus today I am confident that computer science students learn "all ... > long, very long, and not exactly focused on NP completeness). ...
    (comp.programming)