Path: utzoo!utgpu!watmath!atbowler From: atbowler@watmath.waterloo.edu (Alan T. Bowler [SDG]) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <22402@watmath.waterloo.edu> Date: 25 Nov 88 23:17:35 GMT References: <1988Nov8.054845.23998@utstat.uucp> Reply-To: atbowler@watmath.waterloo.edu (Alan T. Bowler [SDG]) Organization: U. of Waterloo, Ontario Lines: 24 In article <1988Nov8.054845.23998@utstat.uucp> geoff@utstat.uucp (Geoff Collyer) writes: >Let your vendor know that you want to see gets deleted from its next >release, delete gets.o from your C library, move gets.o to -lgets, >define gets(s) as "gets is unsafe; use fgets(3)"<><><> in your stdio.h; >do whatever you can to help. > >If your vendor protests your reasonable request, point out that gets, >as part of stdio, is a decade-old backward compatibility hack for >compatibility with the Sixth Edition UNIX Portable I/O Library, which >was utterly replaced by stdio no later than 1979. Accept no excuses; >converting programs from using gets to fgets is largely mechanical, >and stripping trailing newlines is trivial to code yourself. > While the vendor may sympathize with the reasoning, the mechanics of the the US Federal bureaucracy work against this. As long as gets() is in the an official ANSI standard, it will be in a the validation suites. Part of the boiler plate used in sales contracts to the the US government is that the compiler must be an officially validated compiler (lawyers an accountants don't care about the dangers of GETS/FGETS just that it be "certified"). In other words once the ANSI standard gets passed and someone gets themselves declared and official certifier, you can't sell your compiler to a US Federal department without such certification. That is a lot of revenue for a vendor to give up to satisfy your request.