From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115587 invoked by alias); 30 Sep 2016 19:31:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 115528 invoked by uid 89); 30 Sep 2016 19:31:39 -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_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=oversight, qiyaoltc@gmail.com, qiyaoltcgmailcom, sum X-HELO: mail-oi0-f42.google.com Received: from mail-oi0-f42.google.com (HELO mail-oi0-f42.google.com) (209.85.218.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 19:31:29 +0000 Received: by mail-oi0-f42.google.com with SMTP id r126so141686810oib.0 for ; Fri, 30 Sep 2016 12:31:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=V1ZzXRA7tEaXbusCUVf3TIDwo0aZQPBnBDJfodQlvcg=; b=mvSJBKMHcfNdy6SXCpzgftbl8jXP7T0xnd+/FV9Fnh2jEe8vXeKfOqzDIUj5PQoHNu JynPYFI6GVkNj3DuZ5F4eb2DVL4WXOFol3ItMapu4Jn6P9GqtSBgr78ufwgWk6EOqU+h DvgxiB3S17txATZm2iWJU8YYbaioRAQEQJvOIF3EYluPvPrKv2rF+2VSWxvNBu7YIvFg 6b3qjLXvmpqcRQE7dhQJyw4V8f7QpyvzJEFPWCvt0qmmPJLsiX7GfrXSSae7eQAMUW8g M19mn8eBzbvnMQSQyeOM5BmjPkfWqssbj/YNhpjuouT9Pc/BdGXp1WuWnXvna+R/gm7L Re6g== X-Gm-Message-State: AA6/9RmKVtmqu6j4IeAKvZ2Bu6m5s23k20SJwvr3wMvqm4DSS3Ef0WRh0LeobahUeV7Daf1eAzRaOaWMUdCJMQ== X-Received: by 10.202.4.21 with SMTP id 21mr8572504oie.91.1475263887500; Fri, 30 Sep 2016 12:31:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.221.3 with HTTP; Fri, 30 Sep 2016 12:31:27 -0700 (PDT) In-Reply-To: <8760pfhjhl.fsf@tromey.com> References: <1475000192-8789-1-git-send-email-tom@tromey.com> <1475000192-8789-2-git-send-email-tom@tromey.com> <8760phcamm.fsf@tromey.com> <8760pfhjhl.fsf@tromey.com> From: Yao Qi Date: Fri, 30 Sep 2016 21:09:00 -0000 Message-ID: Subject: Re: [RFA 1/3] Fix "fall through" comments To: Tom Tromey Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00439.txt.bz2 On Wed, Sep 28, 2016 at 9:12 PM, Tom Tromey wrote: >>>>>> "Yao" =3D=3D Yao Qi writes: > > Tom> On my machine, clang won't build gdb. From memory there was at > Tom> least some issue compiling .c files in c++ mode, but I think there > Tom> were other problems as well. > > Yao> We can use option '-x c++' to suppress the warnings, but you are > Yao> right, there are some other problems, like some warning options are > Yao> unknown to clang. > > Yeah. I tried it again and there are two issues. > > First, clang++ doesn't like the .c extension: > > clang-3.8: error: treating 'c' input as 'c++' when in C++ mode, this = behavior is deprecated > > I was able to fix this with: > > make CC=3Dclang CXX=3D'clang++ -x c++' CC_LD=3Dclang++ > > After that I got: > > error: unknown warning option '-Wunused-but-set-parameter'; did you m= ean '-Wunused-parameter'? [-Werror,-Wunknown-warning-option] > error: unknown warning option '-Wunused-but-set-variable'; did you me= an '-Wunused-const-variable'? [-Werror,-Wunknown-warning-option] > > This is probably an oversight in warning.m4, as in config.log I see: > > configure:14316: clang++ -c -g -O2 -Wunused-but-set-parameter confte= st.cpp >&5 > warning: unknown warning option '-Wunused-but-set-parameter'; did you= mean '-Wunused-parameter'? [-Wunknown-warning-option] > 1 warning generated. > configure:14316: $? =3D 0 > > Adding 'WERROR_CFLAGS=3D' solves this... but at this point it's fine to > keep fall-through comments, because warnings are disabled anyway. > > It's worth noting that I see tons of "unused function" warnings from > vec.h. when building this way. There's definitely some work to be done > here if anybody wants to use clang. > Yes, I see all of them above in my build. > In sum my view is that it's fine to go ahead with the comment approach. OK. > If someone wants to fix up the clang build I can help convert the > comments to an attribute. (The issue with doing it up-front is > discovering the spots that would need a change -- gcc won't tell us what > they are.) > Agreed. Your patch is good to me then. --=20 Yao (=E9=BD=90=E5=B0=A7)