Compiling help?
Posted: Tue Oct 25, 2005 9:38 am
C programs written by a programmer 10x more skilled than I, but written over a decade ago. I need them, I love them, I had them for UNIX, DOS, Win2k. I got the source code for my Mac (OS 10.4); I compiled them using gcc 4.0.0. They work as they should.
But they use gets() which (apparently) is unsafe. How do I know? Because they warn me every time I use them. "Warning," they say, "this program uses gets() which is unsafe." They're command-line programs that I call from shells, often in loops. So any stderr output I might want to look at is swamped with lines upon lines of these annoying warnings. I get it. It's unsafe. Shut up!
Is there a gcc commandline option that compiles the programs so they won't warn me about gets()? I really don't care how unsafe it is. Another compiler? Any quick solution short of altering the source code (a can of worms I'd like to keep shut)?
But they use gets() which (apparently) is unsafe. How do I know? Because they warn me every time I use them. "Warning," they say, "this program uses gets() which is unsafe." They're command-line programs that I call from shells, often in loops. So any stderr output I might want to look at is swamped with lines upon lines of these annoying warnings. I get it. It's unsafe. Shut up!
Is there a gcc commandline option that compiles the programs so they won't warn me about gets()? I really don't care how unsafe it is. Another compiler? Any quick solution short of altering the source code (a can of worms I'd like to keep shut)?