From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77620 invoked by alias); 9 May 2016 11:28:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 77505 invoked by uid 89); 9 May 2016 11:28:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2492 X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 May 2016 11:28:11 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 775C625C; Mon, 9 May 2016 13:28:09 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vmT12QWG5Oop; Mon, 9 May 2016 13:28:07 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 30F5525B; Mon, 9 May 2016 13:28:07 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id u49BS5w6002338; Mon, 9 May 2016 13:28:05 +0200 (CEST) From: Rainer Orth To: Bernd Schmidt Cc: gcc-patches@gcc.gnu.org Subject: Re: Error out on -fvtable-verify without --enable-vtable-verify References: <57305717.5090508@redhat.com> Date: Mon, 09 May 2016 11:28:00 -0000 In-Reply-To: <57305717.5090508@redhat.com> (Bernd Schmidt's message of "Mon, 9 May 2016 11:23:35 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00606.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 1357 Hi Bernd, > On 05/08/2016 12:44 PM, Rainer Orth wrote: >> With the recent change not to install libvtv without >> --enable-vtable-verify, I noticed that gcc/g++ would still accept >> -fvtable-verify without errors, only to emit obscure link-time errors >> about missing vtv_*.o (which hadn't been installed in that situation >> before) and libvtv. >> >> It seems to me a much better user experience to emit a clear error >> message in this case, which is what this patch does. > > Generally ok, but... > >> +AC_ARG_ENABLE(vtable-verify, >> +[AS_HELP_STRING([--enable-vtable-verify], >> + [enable vtable verification feature])], >> +[case "$enableval" in >> + yes) enable_vtable_verify=yes ;; >> + no) enable_vtable_verify=no ;; >> + *) enable_vtable_verify=no;; >> + esac], >> +[enable_vtable_verify=no]) >> +vtable_verify=`if test $enable_vtable_verify != no; then echo 1; else >> echo 0; fi` >> +AC_DEFINE_UNQUOTED(ENABLE_VTABLE_VERIFY, $vtable_verify, >> +[Define 0/1 if vtable verification feature is enabled.]) > > That looks a little overly complicated. Don't you get the enable_ variables > set by autoconf? And if you do need the case statement, you might as well > set things to 0/1 directly and skip the enable_vtable_verify variable > entirely. that's what you get for blindly copying configure.ac fragments. The following works instead: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=c.a.patch Content-length: 648 diff --git a/gcc/configure.ac b/gcc/configure.ac --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -865,6 +865,14 @@ Valid choices are 'yes' and 'no'.]) ;; esac ], [enable_tls='']) +AC_ARG_ENABLE(vtable-verify, +[AS_HELP_STRING([--enable-vtable-verify], + [enable vtable verification feature])],, +[enable_vtable_verify=no]) +vtable_verify=`if test x$enable_vtable_verify = xyes; then echo 1; else echo 0; fi` +AC_DEFINE_UNQUOTED(ENABLE_VTABLE_VERIFY, $vtable_verify, +[Define 0/1 if vtable verification feature is enabled.]) + AC_ARG_ENABLE(objc-gc, [AS_HELP_STRING([--enable-objc-gc], [enable the use of Boehm's garbage collector with --=-=-= Content-Type: text/plain Content-length: 447 I had to tighten the $enable_vtable_verify test to guard against a non-no argument to --enable-vtable-verify being interpreted as yes. Tested by just running gcc/configure without and with --enable-vtable-verify, and with --enable-vtable-verify=nonstd (handled as no). Ok now? Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University --=-=-=--