From patchwork Thu Apr 17 08:37:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Saunders X-Patchwork-Id: 339816 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 89C011400AC for ; Thu, 17 Apr 2014 18:38:37 +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:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=uYxjTumJr1oojP4P8noyi8o7cIXBQdc2oXe7jGyG1ZV8/bxOoDPEZ gsPuGNbbrkqXMlfHSiRuzqje5k8rp+A6jh1IAcnXBHOdq6S0it2XKn251VO5HHSo oe4seKJsEAG3E25QBqW53dYNoSsoTmy0ggCC0yfjH7erZ2Y22WDQig= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=l+Dc/gGgVkSL/Wi7VyKP5iUvx+Y=; b=c37w0041y3oTYue2aPYf HmQpVPjr8xZQsfOEM9TCQQtP0hdwu3AwTMq76E0jz/Cf/uWj8sv1Co2lKIuMB8hj SXIfMAYK0jHXqEkm5SDBezQOoJIfIskz44RFVrhvNE+gz21HErYbQuGhLPYuKIc8 pmcs0TcH3+hvbiKIfGv5zZw= Received: (qmail 1625 invoked by alias); 17 Apr 2014 08:38:15 -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 1565 invoked by uid 89); 17 Apr 2014 08:38:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.mozilla.org Received: from mx2.corp.phx1.mozilla.com (HELO smtp.mozilla.org) (63.245.216.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Apr 2014 08:38:13 +0000 Received: from iceball.corp.tor1.mozilla.com (69-165-234-187.cable.teksavvy.com [69.165.234.187]) (Authenticated sender: tsaunders@mozilla.com) by mx2.mail.corp.phx1.mozilla.com (Postfix) with ESMTPSA id DF690F279A; Thu, 17 Apr 2014 01:38:11 -0700 (PDT) From: tsaunders@mozilla.com To: gcc-patches@gcc.gnu.org Cc: Trevor Saunders Subject: [PATCH 4/6] enable -Woverloaded-virtual when available Date: Thu, 17 Apr 2014 04:37:20 -0400 Message-Id: <1397723842-29147-4-git-send-email-tsaunders@mozilla.com> In-Reply-To: <1397723842-29147-1-git-send-email-tsaunders@mozilla.com> References: <1397723842-29147-1-git-send-email-tsaunders@mozilla.com> X-IsSubscribed: yes From: Trevor Saunders hi, its a useful warning, and helps catch bugs in the next two patches. bootstrap + regtest passed on x86_64-unknown-linux-gnu, ok? Trev 2014-03-19 Trevor Saunders * configure.ac: Check for -Woverloaded-virtual and enable it if found. * configure: Regenerate. diff --git a/gcc/configure b/gcc/configure index 415377a..1a48ca3 100755 --- a/gcc/configure +++ b/gcc/configure @@ -6427,6 +6427,50 @@ fi done CFLAGS="$save_CFLAGS" +save_CFLAGS="$CFLAGS" +for real_option in -Woverloaded-virtual; do + # Do the check with the no- prefix removed since gcc silently + # accepts any -Wno-* option on purpose + case $real_option in + -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;; + *) option=$real_option ;; + esac + as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 +$as_echo_n "checking whether $CC supports $option... " >&6; } +if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS="$option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_acx_Woption=yes" +else + eval "$as_acx_Woption=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +eval ac_res=\$$as_acx_Woption + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : + strict_warn="$strict_warn${strict_warn:+ }$real_option" +fi + done +CFLAGS="$save_CFLAGS" + c_strict_warn= save_CFLAGS="$CFLAGS" for real_option in -Wold-style-definition -Wc++-compat; do @@ -17927,7 +17971,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17930 "configure" +#line 17974 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18033,7 +18077,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18036 "configure" +#line 18080 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 0336066..b2726e5 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -340,6 +340,8 @@ ACX_PROG_CC_WARNING_OPTS( ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn]) ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-Woverloaded-virtual])), [strict_warn]) +ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) ACX_PROG_CC_WARNING_ALMOST_PEDANTIC( m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ],