From patchwork Thu Apr 11 09:02:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumar Selvaraj X-Patchwork-Id: 235606 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 35CCC2C00E1 for ; Thu, 11 Apr 2013 19:04:39 +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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=I5UgQrp09UaWyU9Sy XM45ezAacGuyTqwo+29zEKnZ6XMa5BQNL3SryAReriAqn/X16ipe2tUhNnrW8Fzt M/nwA1/w5QCO/jJZHDGT620i6yfbh0IHMSi8Qs7gjniT3x6INq28xETKfCzKOwZA koORWLrTXdSBsrhx/sV1TQfEC8= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=3NabsrzuhpDVIQZkwHt4pJ8 z6rc=; b=etjdM0LFFagTlMeP0XZ4zIfUlMdzzceltrAzwsx/PKO2g3B9hIinTmF V/gVDXeYabdwLNjvjDrgfXWf63GD9Wh73wJ3aRHCYrKLvYuEIw+OLNCMVMbsEVp9 +7IghIGvQ9RVuJZVSirIcuV14+PtL1r5608LMgc3QQnmtd0EBliw= Received: (qmail 10686 invoked by alias); 11 Apr 2013 09:03:01 -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 10623 invoked by uid 89); 11 Apr 2013 09:03:00 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_GD autolearn=ham version=3.3.1 Received: from nasmtp01.atmel.com (HELO DVREDG02.corp.atmel.com) (192.199.1.246) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 11 Apr 2013 09:02:59 +0000 Received: from apsmtp01.atmel.com (10.168.254.30) by DVREDG02.corp.atmel.com (10.42.103.31) with Microsoft SMTP Server (TLS) id 14.2.318.1; Thu, 11 Apr 2013 03:02:56 -0600 Received: from PENCHT02.corp.atmel.com (10.168.5.162) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server (TLS) id 14.2.318.1; Thu, 11 Apr 2013 17:02:52 +0800 Received: from atmel.com (10.168.5.13) by cas-ap.atmel.com (10.168.5.162) with Microsoft SMTP Server (TLS) id 14.2.318.1; Thu, 11 Apr 2013 17:02:49 +0800 Date: Thu, 11 Apr 2013 14:32:51 +0530 From: Senthil Kumar Selvaraj To: Jakub Jelinek CC: , Subject: Re: [Patch] Add -gdwarf option to make gcc generate DWARF with the default version Message-ID: <20130411090245.GB1759@atmel.com> References: <20130410132502.GA28317@atmel.com> <20130411070808.GJ16463@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130411070808.GJ16463@tucnak.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) On Thu, Apr 11, 2013 at 09:08:08AM +0200, Jakub Jelinek wrote: > On Wed, Apr 10, 2013 at 06:55:10PM +0530, Senthil Kumar Selvaraj wrote: > > --- gcc/opts.c > > +++ gcc/opts.c > > @@ -1699,6 +1699,18 @@ common_handle_option (struct gcc_options *opts, > > set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc); > > break; > > > > + case OPT_gdwarf: > > + if (arg && strlen(arg) != 0) > > The formatting is wrong. Space before ( above missing. > > > + { > > + error_at (loc, "%<-gdwarf%s%> is ambiguous; " > > + "use %<-gdwarf-%s%> for DWARF version " > > + "or %<-gdwarf -g%s%> for debug level", arg, arg, arg); > > + break; > > + } > > + else > > + { > > + value = opts->x_dwarf_version; > > + } > > A single line statement shouldn't be surrounded inside { }. > > ALso, if the OPT_gdwarf case is meant to fallthru into OPT_gdwarf_, > there should be /* FALLTHRU */ or similar comment. > > > case OPT_gdwarf_: > > if (value < 2 || value > 4) > > error_at (loc, "dwarf version %d is not supported", value); > > Jakub That patch is already in. This patch fixes the problems you pointed out. Regards Senthil gcc/ChangeLog 2013-04-11 Senthil Kumar Selvaraj * gcc/opts.c : Fix formatting and add comment. diff --git gcc/opts.c gcc/opts.c index f96ed16..5f0c49f 100644 --- gcc/opts.c +++ gcc/opts.c @@ -1700,7 +1700,7 @@ common_handle_option (struct gcc_options *opts, break; case OPT_gdwarf: - if (arg && strlen(arg) != 0) + if (arg && strlen (arg) != 0) { error_at (loc, "%<-gdwarf%s%> is ambiguous; " "use %<-gdwarf-%s%> for DWARF version " @@ -1708,9 +1708,9 @@ common_handle_option (struct gcc_options *opts, break; } else - { - value = opts->x_dwarf_version; - } + value = opts->x_dwarf_version; + + /* FALLTHRU */ case OPT_gdwarf_: if (value < 2 || value > 4) error_at (loc, "dwarf version %d is not supported", value);