All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Andreas Dilger <andreas.dilger@intel.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCHv2] fsck: fix strange logic
Date: Wed, 10 Aug 2016 18:54:58 -0400	[thread overview]
Message-ID: <20160810225458.GE10523@thunk.org> (raw)
In-Reply-To: <1470774429-18969-1-git-send-email-andreas.dilger@intel.com>

On Tue, Aug 09, 2016 at 02:27:09PM -0600, Andreas Dilger wrote:
> llvm warns about the confusingly written comparison:
> 
>                               !strncmp(argv[i+1], "-", 1) == 0) {
>     misc/fsck.c:1178 col 9: warning: logical not is only applied to
>       the left hand side of comparison [-Wlogical-not-parentheses]
>     misc/fsck.c:1178 col 9: note: add parentheses after the '!' to
>       evaluate the comparison first
>     misc/fsck.c:1178 col 9: note: add parentheses around left hand
>       side expression to silence this warning
> 
> It makes sense to simplify this to a character comparison rather
> than using strncmp() to check only one character.
> 
> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>

Thanks, applied.

						- Ted

      reply	other threads:[~2016-08-10 22:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 20:12 [PATCH] fsck: fix strange logic Andreas Dilger
2016-08-09 20:26 ` Andreas Dilger
2016-08-10 21:40   ` Theodore Ts'o
2016-08-09 20:27 ` [PATCHv2] " Andreas Dilger
2016-08-10 22:54   ` Theodore Ts'o [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=20160810225458.GE10523@thunk.org \
    --to=tytso@mit.edu \
    --cc=andreas.dilger@intel.com \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.