0

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

4
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by Narue
0

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.

0

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

1

>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.