This is the mail archive of the mailing 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]

Re: [Patch] PR55189 enable -Wreturn-type by default

On Wed, 4 Jun 2014, Sylvestre Ledru wrote:

> Hello,
> Finally, I have been able to update all tests with -Wreturn-type enabled
> by default. AFAIK, under GNU/Linux Debian Jessie 64 bits, there is no
> PASS->FAIL tests.
> Now, I would like to know if I can commit that into the repository. Who
> can review that?
> As attachment, you will find the actual (tiny) patch.
> I split the tests update by languages. As they are big ( 1260 files
> changed, 1638 insertions(+), 903 deletions(-) ), I uploaded the patches
> on my server:

Some of those patches appear to be addressing cases where control appears 
to reach the end of a function returning non-void, as opposed to cases 
where the return type defaults to int.  As I said in 
<>, I don't think that 
warning is appropriate to enable by default as it catches perfectly valid 
C90 / C99 code that avoids using extensions to annotate noreturn 

(I *do* think it's appropriate to enable by default the warning about 
return type defaulting to int - more generally, to enable -Wimplicit-int 
-Wimplicit-function-declaration - and the -Wreturn-type warning about a 
return statement without a value in a function returning non-void also 
seems appropriate to enable by default.  Warning about the absence of any 
return statement in a function returning non-void is probably also a 
reasonable default warning from the -Wreturn-type set; it's specifically 
the flow-based warnings that can give false positives in the absence of 
noreturn annotations that I'm dubious about enabling by default.)

Joseph S. Myers

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