From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] valgrind: do not require valgrind 3.4.0 or newer
Date: Thu, 05 Feb 2009 16:12:30 -0800 [thread overview]
Message-ID: <7vljska0ep.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <349b2bb9b8f5a6762cccb7834d82125ee4382436.1233867737u.git.johannes.schindelin@gmx.de> (Johannes Schindelin's message of "Thu, 5 Feb 2009 22:03:00 +0100 (CET)")
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> Valgrind 3.4.0 is pretty new, and even if --track-origins is a nice
> feature, it is not the end of the world if that is not available. So
> play nice and use that option only when only an older version of
> valgrind is available.
>
> In the same spirit, refrain from the use of '...' in suppression
> files, which is also a feature only valgrind 3.4 and newer understand.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Thanks.
> +TRACK_ORIGINS=
> +
> +VALGRIND_VERSION=$(valgrind --version)
> +VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
> +VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
> +test 3 -gt "$VALGRIND_MAJOR" ||
> +test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
> +TRACK_ORIGINS=--track-origins=yes
It took me a while to convince myself that
"3 > major || (3 == major && 4 > minor) || do-this"
is equivalent to
"if (3 < major || (3 == major && 4 <= minor)) { do-this }"
which would be:
if test 3 -lt "$VALGRIND_MAJOR" ||
test 3 -eq "$VALGRIND_MAJOR" -a 4 -le "$VALGRIND_MINOR"
then
TRACK_ORIGINS=--track-origins=yes
fi
or more commonly:
if test "$VALGRIND_MAJOR" -gt 3 ||
test "$VALGRIND_MAJOR" -eq 3 -a "$VALGRIND_MINOR" -ge 4
then
TRACK_ORIGINS=--track-origins=yes
fi
next prev parent reply other threads:[~2009-02-06 0:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1233858507u.git.johannes.schindelin@gmx.de>
2009-02-05 18:34 ` [PATCH] valgrind: do not require valgrind 3.4.0 or newer Johannes Schindelin
2009-02-05 19:00 ` Peter Baumann
2009-02-05 20:20 ` Johannes Schindelin
2009-02-05 20:32 ` Junio C Hamano
2009-02-05 20:51 ` Johannes Schindelin
2009-02-05 21:03 ` Johannes Schindelin
2009-02-06 0:12 ` Junio C Hamano [this message]
2009-02-06 0:40 ` Johannes Schindelin
2009-02-06 0:52 ` Junio C Hamano
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=7vljska0ep.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).