From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70782 invoked by alias); 30 Nov 2016 16:51:04 -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 70766 invoked by uid 89); 30 Nov 2016 16:51:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=eclipse, 20161130 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Nov 2016 16:51:01 +0000 Received: by simark.ca (Postfix, from userid 33) id C96A41E18F; Wed, 30 Nov 2016 11:50:59 -0500 (EST) To: John Baldwin Subject: Re: [PATCH 1/3] Fix mismatched struct vs class tags. X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 30 Nov 2016 16:51:00 -0000 From: Simon Marchi Cc: Pedro Alves , gdb-patches@sourceware.org In-Reply-To: <1853167.ixQKmG4D0P@ralph.baldwin.cx> References: <20161123200652.89209-1-jhb@FreeBSD.org> <1573845.CKxfuZpZBq@ralph.baldwin.cx> <31fa3dbd-e1d1-1fd2-7774-8bc82fd8b37d@redhat.com> <1853167.ixQKmG4D0P@ralph.baldwin.cx> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.2 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg01002.txt.bz2 On 2016-11-30 11:23, John Baldwin wrote: > One other clangism is that clang warns about compiling a .c file in > C++. > It wants an explicit '-x c++' to force the language mode. However, > simply > adding this to CXX_FLAGS doesn't work as it is included in both > compiling > and linking (and for the link it causes clang to try to parse all the > object > files as C++ source leading to bizarre errors). I think you could add it in its own variable: FORCE_LANG_FLAG = -x c++ and add that to INTERNAL_CFLAGS. > I assume a massive .c -> .cc > (or .cxx, etc.) rename is not in the roadmap (it would presumably be > very > disruptive to pending patchsets)? I think it will have to be done at some point... it will be a bit weird and counter intuitive for newcomers to see .c files containing C++. That, and analysis tools that select the language based on the extension. For example, I use Eclipse CDT for my development, and it assumes C code for .c files by default. I can go change some obscure setting to force it to consider it as C++, but it would be nicer for everybody if we didn't have to do that. Actually, I just checked and it's the same with vim and emacs. If we want to do it right, we would have to rename .h into .hpp or .hh as well. And it would be as painful to do it in 5 years as it would be to do it now, so I don't see why we would wait... About the merging of pending patches: if I try to apply a patch including a change to a file that was renamed with "git am", it fails. But if with "git rebase", git seems to handle it correctly. So there's hope.