From patchwork Mon May 5 14:13:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 345732 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 0EE03140338 for ; Tue, 6 May 2014 00:13:50 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=QKehcuOKsIdYmMPbfVR2IeCvCXeeGLEXMMA2IaNZsiStFpR1AOPos Nddvs2O1Bf/Mtwwm+19HGxVH9y/Xd2zUhufWCrGAwrxab4TXgM7wEbl5Yglp1NLe G+0PithaK/YFmh0ytCEu33cAebSdKO4lvg/FhQ6Ymc/MbDDx335TeY= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=LAnxR1QSB+Idg/PACqdTZytwneU=; b=QQ+eL8tMMDOLc9yGtRfk z9Bzg8wIQnNJlWhRqjid4M+LgbhaUfvFky+86v8ALIbgrSfPwzRz4uwAxXDcVGCZ oEe9Q02f/gDHYT9NzozdqX31l4OvipsmnfUNs8bluQF8assjjZ319P0epKkwoUae XjdFJlWnqxkN0gTlMn14eMc= Received: (qmail 30851 invoked by alias); 5 May 2014 14:13:22 -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 30771 invoked by uid 89); 5 May 2014 14:13:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 May 2014 14:13:20 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s45EDIfc032689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 5 May 2014 10:13:19 -0400 Received: from redhat.com (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s45EDFYP009698 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 5 May 2014 10:13:18 -0400 Date: Mon, 5 May 2014 16:13:15 +0200 From: Marek Polacek To: GCC Patches Subject: [PATCH] Error for invalid args to -fsanitize (PR driver/61065) Message-ID: <20140505141315.GP11802@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) It seems it's better to error out when someone passes bogus option to -fsanitize rather than only give a warning. Error gives non-zero exit status so with this patch the behavior is friendlier to configure scripts. Bootstrapped on x86_64-linux, ok for trunk? 2014-05-05 Marek Polacek PR driver/61065 * opts.c (common_handle_option): Call error_at instead of warning_at. Marek diff --git gcc/opts.c gcc/opts.c index 3c214f0..f15852d 100644 --- gcc/opts.c +++ gcc/opts.c @@ -1495,9 +1495,9 @@ common_handle_option (struct gcc_options *opts, } if (! found) - warning_at (loc, 0, - "unrecognized argument to -fsanitize= option: %q.*s", - (int) len, p); + error_at (loc, + "unrecognized argument to -fsanitize= option: %q.*s", + (int) len, p); if (comma == NULL) break;