HI everybody, currently I'm using ubuntu linux.If I write program in c using c language.I'm getting a warning message while compiling.So if there any to avoid this, please inform me.

Edited by harikrishna439: n/a

8 Years
Discussion Span
Last Post by Narue

Well... the easiest way to avoid getting warnings is to write correct programs. Perhaps post some actual code. You can force gcc to hide warnings by compiling with the -w flag. Note the lowercase.


Read your post once before posting...if you coundn't get anything from that, how come others make it out ???


>I'm getting a warning message while compiling.
Judging by your thread title, the warning is something along the lines of "gets is unsafe". The usual recommendation is to prefer fgets because it allows one to provide a limit to the buffer whereas gets will just happily read until a newline (walking right off the end of the buffer if necessary).

>You can force gcc to hide warnings by compiling with the -w flag.
Note that while it's possible to hide warnings, most of the time it's a supremely stupid idea. Warnings are there for a reason. They don't keep a program from compiling, but they do notify you of potential problems at runtime.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.