svn commit: r252376 - head/lib/libutil

mdf at FreeBSD.org mdf at FreeBSD.org
Sat Jun 29 16:42:50 UTC 2013


On Sat, Jun 29, 2013 at 9:36 AM, Tim Kientzle <kientzle at 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


More information about the svn-src-head mailing list