Manuel López-Ibáñez - Wextra and Wreturn-type interaction (PR7651) (original) (raw)

This is the mail archive of the gcc-patches@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]

:ADDPATCH C:

Wextra gives a warning when a function may return with and without a value, for example:

foo (a) { if (a > 0) return a; }

However, this warning is completely redundant, since Wreturn-type (that is enabled by -Wall) will give a warning for any 'return' without value, in a function whose return-type is not 'void' and about a 'return' with a value, in a function whose return-type is 'void'. I was not able to construct an example for which Wextra warns but Wreturn-type does not.

So this patch removes this warning from Wextra and improves the description of Wreturn-type.

Boostrapped and regression tested.OK for mainline?
2007-02-12 Manuel Lopez-Ibanez manu@gcc.gnu.org

PR middle-end/7651

testsuite/

Attachment:wextra-wreturn-type.diff
Description: Text document


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