Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jun 2013 09:42:49 -0700
From:      mdf@FreeBSD.org
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r252376 - head/lib/libutil
Message-ID:  <CAMBSHm_%2BYwAp2egVZefBar_V6acC4erMm3LyTj62KFxHPunCgQ@mail.gmail.com>
In-Reply-To: <A89C1472-264E-4B9C-8711-763ED156E9D2@FreeBSD.org>
References:  <201306291552.r5TFqnLV022460@svn.freebsd.org> <20130629161914.GD91021@kib.kiev.ua> <A89C1472-264E-4B9C-8711-763ED156E9D2@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 29, 2013 at 9:36 AM, Tim Kientzle <kientzle@freebsd.org> wrote:

>
> On Jun 29, 2013, at 9:19 AM, Konstantin Belousov wrote:
>
> > On Sat, Jun 29, 2013 at 03:52:49PM +0000, Tim Kientzle wrote:
> >> Author: kientzle
> >> Date: Sat Jun 29 15:52:48 2013
> >> New Revision: 252376
> >> URL: http://svnweb.freebsd.org/changeset/base/252376
> >>
> >> Log:
> >>  Fix -Wunsequenced warning
> > What is this ? From the name of the warning, it sounds as if the problem
> > is in the lack of sequence point between two modifications of the same
> > variable in the expression ?
> >
> > But, there function' argument evaluation and function call are separated
> > by seq point, AFAIR.  Could you, please, clarify ?
>
> I think you're right about that, though I'd have to
> look at the spec to be sure.
>
> Not sure why clang would report this as a -Wunsequenced
> warning.  The implied store here is certainly redundant, though.
>

It may be like other warnings (-Wmissing-field-initializers, I'm looking at
you) that warn about currently correct, but potentially problematic
behavior.

In particular, if any of the functions is re-implemented as a macro, the
sequence point goes away, and this code is broken without the code's author
having made any changes.  So it seems like a reasonable warning.

Thanks,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMBSHm_%2BYwAp2egVZefBar_V6acC4erMm3LyTj62KFxHPunCgQ>