From: A. V. Le Blanc (zlsiial@uts.mcc.ac.uk)
Date: 07/30/92


From: zlsiial@uts.mcc.ac.uk (A. V. Le Blanc)
Subject: Re: mtools, compiling problems
Date: 30 Jul 1992 12:39:43 GMT

In article <5561@umriscc.isc.umr.edu> dminer@mcs213f.cs.umr.edu (Dan Miner) writes:
> Well, I finally got around to updating my system. I got
>bunches of stuff. I have gcc 2.2.2 installed. Now, I'm trying to
>compile the mtools (the one that is one file for all) and I got
>a problem. When linking, gcc complains that got_signal isn't there.

The patches which I used to compile the single file mtools in the last
MCC interim version of Linux can be found at ftp.mcc.ac.uk in mtool205.ud.Z
in /pub/linux/mcc-interim/0.96c/patches. They do not have this problem.

>Also, gcc complains about gets() in stdio.. saying that you shouldn't
>use it? Why on earth is that in there? If you have functions that
>are that unreliable, REMOVE IT! I do believe it is ansi, so why say
>something like that? *fume*

My patches referred to above in fact change all the gets() calls to
fgets(). The gets function is inherently dangerous because it makes
no safety check on the length of the string read; therefore any
call to gets may cause the program to abort or, worse, overwrite
other data if the input is longer than the buffer. I suspect the
ANSI committee would have liked to drop gets, but couldn't give the
possibilty of dropping it serious consideration because of its
extensive use in existing programs. The use of gets was one of the
weaknesses exploited by the renowned Morris Internet Worm. Anyway,
the GNU C library (to which I think the warning belongs) clearly
must contain gets to be ANSI, but wishes to discourage you from
using it. Whether the chosen method is ideal is debatable, and I
don't know whether you can suppress the warning messages.

     -- Owen
     LeBlanc@mcc.ac.uk