All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marian Csontos <mcsontos@redhat.com>
To: lvm-devel@redhat.com
Subject: Fwd: [linux-lvm] LVM2.2.02.103/tools/lvchange.c:779: bad if test ?
Date: Thu, 24 Oct 2013 13:51:32 +0200	[thread overview]
Message-ID: <526909C4.3080504@redhat.com> (raw)
In-Reply-To: <DUB118-W973F5E6250AE338D1B00D9C030@phx.gbl>

And the && is wrong as well.
So || instead of && and inside braces &&s instead of ||s.

Now it matches anything /[^:].$/ but I believe it was intended to be 
/[^:].$|:[tyn]$/ which is wrong too but in fact should be /[^:].$/ so it 
is in fact weirdly written correct implementation. =8-O

I wonder, is it possible to have the PV matching /:[^tyn]$/?
In such case it is, then /:[tyn]$/ should be valid as well, shold not it?

I suggest:

if /[^:]./:
     - add default
else if /:[^tyn]$/
     - should be internal error
     - recovery: last character should be _replaced_ by default
else # /:[tyn]/
     - NOP

-- Martian

-------- Original Message --------
Subject: [linux-lvm] LVM2.2.02.103/tools/lvchange.c:779: bad if test ?
Date: Wed, 23 Oct 2013 20:26:04 +0000
From: David Binderman <dcb314@hotmail.com>
Reply-To: LVM general discussion and development <linux-lvm@redhat.com>
To: linux-lvm@redhat.com <linux-lvm@redhat.com>

Hello there,

I just compiled LVM2.2.02.103 with the extra Linux gcc compiler
flag -Wlogical-op

It said

lvchange.c:779:10: warning: logical 'or' of collectively exhaustive 
tests is always true [-Wlogical-op]

Source code is

                  ((tmp_str[tmp_str_len - 1] != 't') ||
                   (tmp_str[tmp_str_len - 1] != 'y') ||
                   (tmp_str[tmp_str_len - 1] != 'n'))))

Suggest swap || for &&

Regards

David Binderman 		 	   		

_______________________________________________
linux-lvm mailing list
linux-lvm at redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




  reply	other threads:[~2013-10-24 11:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 20:26 [linux-lvm] LVM2.2.02.103/tools/lvchange.c:779: bad if test ? David Binderman
2013-10-24 11:51 ` Marian Csontos [this message]
2013-10-24 15:48   ` Fwd: " Brassow Jonathan

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=526909C4.3080504@redhat.com \
    --to=mcsontos@redhat.com \
    --cc=lvm-devel@redhat.com \
    /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.