Home > Articles > Operating Systems, Server

This chapter is from the book

This chapter is from the book

3.6 Handling Warning and Error messages

The GNU compiler generates two types of messages when compiling source code. Warning messages are non-critical messages and the compiler can build the output code even if there are warning messages. Error messages are fatal messages and compiler is not able to generate output files when an error occurs. By default, the compiler does not display many warning messages. You may like to see these messages, for example, when you want to get a release of a software package. Usually the release version of software should be compiled without any warning message. Using options that start with –W, you can control which types of messages should be displayed. It is a good idea to always use –Wall option in your Makefiles. The reason is that warnings often signify problems in code that you will want to see. Please see gcc man pages to get a feel of options controlling warning messages.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.