All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 0/4] checkbashisms.pl in make check + fixed docs
Date: Thu, 2 Sep 2021 17:09:55 +0200	[thread overview]
Message-ID: <YTDpQxDDPY3HCli6@pevik> (raw)
In-Reply-To: <015140e9-0eba-4057-4a91-35d958af2bb8@jv-coder.de>

Hi Joerg,

> Hi

> one general question about this: How to we want to handle false-positives?
Good point, thanks! Generally we can disable things which does not work for us.
I'd be pragmatic, if something works on most of shells and let's disable it,
just not disable needed test just due one false positive.

> e.g.:

> $ checkbashisms testcases/kernel/controllers/memcg/functional/memcg_lib.sh
> possible bashism in
> testcases/kernel/controllers/memcg/functional/memcg_lib.sh line 387 ('(('
> should be '$(('):
> ??????? local limit_down=$(( PAGESIZE * ((limit + PAGESIZE - 1) / PAGESIZE)
> ))

> This is obviously a false positive, but could probably be adding a space
> between the brackets.

The only thing how to get away this was to introduce another variable:
	local limit_psize=$((limit + PAGESIZE - 1))
	local limit_down=$((PAGESIZE * (limit_psize / PAGESIZE)))

I'm not sure if it's not POSIX, but works because supported by all shells
(similar case to 'typo' not being POSIX but POSIX extensions). Maybe we should
report it.

> or

> $ checkbashisms testcases/kernel/connectors/pec/cn_pec.sh
> possible bashism in testcases/kernel/connectors/pec/cn_pec.sh line 127
> (should be >word 2>&1):
> ??????????????? done <&${fd_act}

> This one is just a false positive and I have no clue how to prevent this.
> I think the script does not like the <&, but this is posix...
The same here, I'm not sure if it's POSIX. &> definitely is not POSIX.
I remember we were talking about it. Can we avoid it somehow?

Kind regards,
Petr


> Joerg

  reply	other threads:[~2021-09-02 15:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 10:37 [LTP] [PATCH 0/4] checkbashisms.pl in make check + fixed docs Petr Vorel
2021-09-02 10:37 ` [LTP] [PATCH 1/4] doc: Mention make check Petr Vorel
2021-09-02 13:17   ` Cyril Hrubis
2021-09-02 15:46     ` Petr Vorel
2021-09-02 10:37 ` [LTP] [PATCH 2/4] Vendor checkbashisms.pl version 2.20.5 Petr Vorel
2021-09-02 13:25   ` Cyril Hrubis
2021-09-02 10:37 ` [LTP] [PATCH 3/4] rules.mk: Add checkbashisms to 'make check' for *.sh Petr Vorel
2021-09-02 13:27   ` Cyril Hrubis
2021-09-02 15:51     ` Petr Vorel
2021-09-02 10:37 ` [LTP] [PATCH 4/4] doc: Update for vendored checkbashisms.pl Petr Vorel
2021-09-02 13:29   ` Cyril Hrubis
2021-09-09 10:55     ` Petr Vorel
2021-09-09 10:55       ` Petr Vorel
2021-09-02 11:50 ` [LTP] [PATCH 0/4] checkbashisms.pl in make check + fixed docs Petr Vorel
2021-09-02 14:01 ` Joerg Vehlow
2021-09-02 15:09   ` Petr Vorel [this message]
2021-09-03  4:28     ` Joerg Vehlow
2021-09-03  7:43       ` Petr Vorel
2021-09-03  8:10         ` Joerg Vehlow
2021-09-03  8:53           ` Petr Vorel
2021-09-02 15:14   ` Petr Vorel

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=YTDpQxDDPY3HCli6@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.