From patchwork Thu Aug 14 18:48:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= X-Patchwork-Id: 379979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E583B140097 for ; Fri, 15 Aug 2014 04:49:22 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=UvocKBlWskMzcIXUL/fT1dAS/PNMDcF24UP6IEWLKX+ ektXlhj80ITSWSt6nxHluTbK78pIA8G5Mu6QWSQJHAQvy1TbFFHuVtQcAv9O1RQw bFSTWYUu06YdDzJSob2KPOMJw8WgXfAftN81d5b6u+Slwqpoa257QvLO5cbVABOQ = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=Y5omfgMfLWl0IWAmcpMBf3C3M3I=; b=bjy9kpe19AzulIuz+ wMxFcCzGlvZ4tL3nAU3T6AMdoWf6SFf8zBl5Cjmsn2LZbl5se0g0ySnr5f3CDbCz oOwg2M6PCYasUe32shgdt8iiIdytd0NRTs4kKmjy0HC9joVVHCDG8vXm+49Hfj4C axXOAQVye8b2ePMN3m03K9bOmw= Received: (qmail 2067 invoked by alias); 14 Aug 2014 18:49:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2057 invoked by uid 89); 14 Aug 2014 18:49:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_05, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f169.google.com Received: from mail-we0-f169.google.com (HELO mail-we0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 14 Aug 2014 18:49:09 +0000 Received: by mail-we0-f169.google.com with SMTP id u56so1469533wes.14 for ; Thu, 14 Aug 2014 11:49:07 -0700 (PDT) X-Received: by 10.194.62.67 with SMTP id w3mr14458186wjr.32.1408042146992; Thu, 14 Aug 2014 11:49:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.217.80.73 with HTTP; Thu, 14 Aug 2014 11:48:46 -0700 (PDT) From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Thu, 14 Aug 2014 20:48:46 +0200 Message-ID: Subject: Re: [Patch] PR55189 enable -Wreturn-type by default To: Gcc Patch List Cc: Jason Merrill , "Joseph S. Myers" , Sylvestre Ledru X-IsSubscribed: yes Does this patch actually enables -Wimplicit-int by default? The default without Init() should be zero! And according to this: https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01367.html we still want -Wno-implicit to disable -Wimplicit-int (and -Werror=implicit to set -Werror=implicit-int), so the LangEnabledBy() should stay. The documentation could say: "This warning is enabled by default and it is also controlled by -Wimplicit." Cheers, Manuel. --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -693,6 +693,10 @@ gfc_handle_option (size_t scode, const char *arg, int value, gfc_option.warn_line_truncation = value; break; + case OPT_Wmissing_return: + warn_missing_return = value; + break; + case OPT_Wrealloc_lhs: gfc_option.warn_realloc_lhs = value; break; The entry in c.opt says this is a C/C++ option, why you need this? +Wmissing-return +C ObjC C++ ObjC++ Var(warn_missing_return) LangEnabledBy(C ObjC C++ ObjC++,Wreturn-type) +Warn whenever control may reach end of non-void function This should prevent that using -Wreturn-type in Fortran tries to enable -Wmissing-return, if not that is a bug. In any case, the work-around should be adding Wmissing-return to fortran/lang.opt with a ??? comment, not there. --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -472,7 +472,7 @@ C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning LangEnabledBy(C Warn about implicit function declarations Wimplicit-int -C ObjC Var(warn_implicit_int) Warning LangEnabledBy(C ObjC,Wimplicit) +C ObjC Var(warn_implicit_int) Warning Warn when a declaration does not specify a type Wimport diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5ae910c..3f2019a 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3615,7 +3615,7 @@ This warning is enabled by @option{-Wall} in C++. @opindex Wimplicit-int @opindex Wno-implicit-int Warn when a declaration does not specify a type. -This warning is enabled by @option{-Wall}. +This warning is enabled by default. @item -Wimplicit-function-declaration @r{(C and Objective-C only)} @opindex Wimplicit-function-declaration