KDevelop Felhasználói Kézikönyv -Fordítás alatt: Referencia Kézikönyv a Unix operációs rendszer alatt futó KDevelop Integrált Fejlesztői Környezethez, 1.0 Verzió | ||
---|---|---|
Vissza | Fejezet 9. Build beállítások | Tovább |
The following gives a description about the Compiler warning options that can be set on page 3 of the project options dialog. The explanations are taken from the man page for GCC, egcs version 1.1.1. The warnings themselves are diagnostic messages that indicate that constructions may cause errors .
Standard `-W' options combined.
Compile with -W. This option sets options not included in -Wall which are very specific. Please read GCC-Info for more information.
Warn about certain constructs that behave differently in traditional and ANSI C.
Warn if an undefined identifier is evaluated in an `&#;if' directive.
Warn whenever a local variable shadows another local variable .
Warn whenever two distinct identifiers match in the first len characters. This may help you prepare a program that will compile with certain obsolete, brain-damaged Compiler s.
Warn whenever an object of larger than LEN bytes is defined.
Warn about anything that depends on the «size of» a function type or of void. GNU C assigns these types a size of 1, for convenience in calculations with void * pointers and pointers to functions.
Warn whenever a function call is cast to a non-matching type. For example, warn if int malloc() is cast to anything *.
Warn whenever a pointer is cast so as to remove a type qualifier from the target type. For example, warn if a const char * is cast to an ordinary char *.
Warn whenever a pointer is cast such that the required alignment of the target is increased. For example, warn if a char * is cast to an int * on machines where integers can only be accessed at two- or four-byte boundaries.
Give string constants the type const char&[;length] so that copying the address of one into a non-const char * pointer will get a warning. These warnings will help you find at compile time code that can try to write into a string constant, but only if you have been very careful about using const in declaration s and prototypes. Otherwise, it will just be a nuisance; this is why we did not make `-Wall' request these warnings .
Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype. This includes conversions of fixed point to floating and vice versa, and conversions changing the width or signedness of a fixed point argument except when the same as the default promotion.
Warn when a comparison between signed and unsigned values could produce an incorrect result when the signed value is converted to unsigned.
Warn if any functions that return structures or unions are defined or called. (In languages where you can return an array, this also elicits a warning.)
Warn if a global function is defined without a previous prototype declaration . This warning is issued even if the definition itself provides a prototype. The aim is to detect global functions that fail to be declared in header files.
Warn if a global function is defined without a previous declaration . Do so even if the definition itself provides a prototype. Use this option to detect global functions that are not declared in header files. -Wredundant-decls Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing.
Warn if anything is declared more than once in the same scope even in cases where multiple declaration is valid and changes nothing.
Warn if an extern declaration is encountered within an function.
Warn if a function can not be inlined, and either it was declared as inline, or else the -fin*line-functions option was given.
Warn if an old-style (C-style) cast is used within a program
(C++ only.) In a derived class, the definitions of virtual functions must match the type signature of a virtual function declared in the base class. Use this option to request warnings when a derived class declares a function that may be an erroneous attempt to define a virtual function: that is, warn when a function with the same name as a virtual function in the base class, but with a type signature that doesn't match any virtual functions from the base class.
Warn when g++'s synthesis behavior does not match that of cfront.
(-Werror) Treat warnings as errors ; abort compilation after any warning.
For a release of your project, it is recommended to enable -Wall.