public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@freebsd.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 0/3] Fix various C++ related clang warnings
Date: Wed, 23 Nov 2016 23:23:00 -0000	[thread overview]
Message-ID: <1578473.QnoY8bLuFt@ralph.baldwin.cx> (raw)
In-Reply-To: <30005d3699beb3adc0f38d0499611e4d@polymtl.ca>

On Wednesday, November 23, 2016 05:18:28 PM Simon Marchi wrote:
> On 2016-11-23 15:06, John Baldwin wrote:
> > These patches fix various new C++ warnings reported by clang 3.8.0.
> > The last one regarding std::move is a bit surprising I think, but
> > there's a not-bad answer to a similar issue here:
> > 
> > http://stackoverflow.com/questions/19267408/why-does-stdmove-prevent-rvo
> > 
> > John Baldwin (3):
> >   Fix mismatched struct vs class tags.
> >   Add noexcept to custom non-throwing new operators.
> >   Do not use std::move when assigning an anonymous object to a
> >     unique_ptr.
> 
> Hi John,
> 
> When I tried to build gdb and gdbserver on Linux with clang, I got many 
> more warnings/errors (often relevant).  I assume you have many more 
> fixups to do to actually get it building on FreeBSD with clang?

I build without -Werror when using clang.  There are several more warnings
beyond these.  One set in particular is a set of -Wunused-function that
get generated by VEC().  My understanding is that VEC() will be replaced by
templates at some point which will trim many of the current clang warnings.
There are several tautological compare warnings due to doing
'if (foo >= 0 && foo <= X)' when 'foo' is unsigned (the comparison against
0 is always true in that case).  However, I sometimes think that listing
the explicit bounds can be useful to the reader in those cases so have
been hesitant to change those.  One option we could take is to provide
different WARN_CFLAGS for GCC vs clang, but I haven't sat down to figure out
how to do that.  I do try to fix the warnings that I think are relevant
however (such as in this set).

-- 
John Baldwin

      reply	other threads:[~2016-11-23 23:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 20:07 John Baldwin
2016-11-23 20:08 ` [PATCH 3/3] Do not use std::move when assigning an anonymous object to a unique_ptr John Baldwin
2016-11-23 21:19   ` Simon Marchi
2016-11-23 23:31     ` John Baldwin
2016-11-24  0:08       ` Simon Marchi
2016-11-24 16:52         ` Pedro Alves
2016-11-23 20:08 ` [PATCH 1/3] Fix mismatched struct vs class tags John Baldwin
2016-11-23 20:58   ` Simon Marchi
2016-11-23 23:23     ` John Baldwin
2016-11-24 17:02       ` Pedro Alves
2016-11-24 17:47         ` John Baldwin
2016-11-24 18:50           ` Pedro Alves
2016-11-24 19:15             ` John Baldwin
2016-11-30 11:39               ` Pedro Alves
2016-11-30 16:23                 ` John Baldwin
2016-11-30 16:38                   ` Pedro Alves
2016-11-30 16:52                     ` Simon Marchi
2016-11-30 16:51                   ` Simon Marchi
2016-11-30 17:08                     ` Pedro Alves
2016-11-30 17:54                       ` Simon Marchi
2016-11-30 17:59                     ` Eli Zaretskii
2016-11-23 20:08 ` [PATCH 2/3] Add noexcept to custom non-throwing new operators John Baldwin
2016-11-24 17:03   ` Pedro Alves
2016-11-23 22:18 ` [PATCH 0/3] Fix various C++ related clang warnings Simon Marchi
2016-11-23 23:23   ` John Baldwin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1578473.QnoY8bLuFt@ralph.baldwin.cx \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).