3.5.1.1 Disabling Messages

The compiler will issue warnings to alert you to potential problems in your source code.

All warning messages can be disabled by using -w option.

You can turn off explicit warnings by using the -Wno-message option, where message relates to the warning type, for example, the -Wno-return-type option will prevent the warnings associated with functions whose return type defaults in int. When a warning is produced by the compiler, it prints in square brackets the associated warning option that controls this warning. For example, if the compiler issues the warning:

avr.c:13:1: warning: 'keep' attribute directive ignored [-Wattributes]

you can disable this warning using the option -Wno-attributes.

Note: Disabling warning messages in no way fixes the condition that triggered the message. Always use extreme caution when exercising these options.

You can enable a more complete set of warning messages about questionable constructions by using -Wall. The -Wextra option turns on additional messages. Alternatively, you can enable individual messages using the -Wmessage option, for example -Wunused-function will ensure that warnings are produced for functions that are never called.