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.

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.