Manuel LÃpez-IbÃÃez - RFC: Wextra digest (fixing PR7651) (original) (raw)

This is the mail archive of the gcc@gcc.gnu.orgmailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

The goal is to fix PR7651 and convert Wextra into a super-option, that is an -W* option that just enables other options but it doesn't emit warnings by itself (other super-options are Wall and Wunused).

This is a summary of the current status of Wextra for mainline to the best of my knowledge. I welcome comments on how to group and name the new -W* options that will take over the warnings produced by Wextra.

In Java, Wextra warns for unreachable bytecode. (maybe this should be warned by -Wunreachable-code or by a new option -Wunreachable-bytecode)

In C++, it warns for* Subscripting an array which has been declared register.* Taking the address of a variable which has been declared register.* A base class is not initialized in a derived class' copy constructor.

Only for C, it enables:

For both C and C++:* A function can return either with or without a value.

* -Wuninitialized is enabled if -Ox is given. (not documented)

* -Wclobbered : A variable might be changed by longjmp or vfork.* -Wempty-body : An empty body occurs in an if or else statement.

In ./gcc/config/sh/symbian.c:158 there is a warning enabled by Wextra with the following code (notice the OPT_Wattributes) :

/* We ignore the dllimport attribute for inline member functions. This differs from MSVC behavior which treats it like GNUC 'extern inline' extension. */ else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) { if (extra_warnings) warning (OPT_Wattributes, "inline function %q+D is declared as " "dllimport: attribute ignored", decl); return false; }

Finally, the manual page claims that Wextra warns for any of several floating-point events that often indicate errors, such as overflow, underflow, loss of precision, etc. I wasn't able to find any instance of this. I am fairly sure that Wextra doesn't do such thing.

Cheers,Manuel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]