Using gcc to compile my program with get function

Whenever I try to do this, I get this:

warning: the `gets' function is dangerous and should not be used

now, I know why this feature is terrible. But for the sake of composing my already written program, I have to use this function. What should I do to prevent this warning from appearing? [or a function with the EXACT same properties. fgets is slightly different so my code won't work]

+3


source to share


3 answers


You don't have to suppress the warning. If you really feel like you can't live with the warning, write a simple script that parses the output and discards the warning and calls it appropriately for you to build with:

make ... | I-am-fully-cognizant-of-the-fact-that-this-program-uses-an-unsafe-function-and-the-resulting-executable-is-completely-unsafe

      



It would be unwise to shorten the filter name.

+1


source


Moved answer to

fooobar.com/questions/496680 / ...



Will remove it after a bit.

0


source


Have you tried compiling with -w

to disable warnings?

-1


source







All Articles