This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Systemtap preprocessor and short-circuit boolean evaluation
- From: Andrew Stitcher <astitcher at redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: SystemTap Mailing List <systemtap at sourceware dot org>
- Date: Thu, 02 Feb 2012 17:04:13 -0500
- Subject: Re: Systemtap preprocessor and short-circuit boolean evaluation
- References: <1328197956.3604.39.camel@localhost.localdomain> <y0m1uqd43a9.fsf@fche.csb>
On Thu, 2012-02-02 at 11:18 -0500, Frank Ch. Eigler wrote:
> Andrew Stitcher <astitcher@redhat.com> writes:
>
> > [...]
> > What I'd like to be able to write is:
> > %( $# >= 1 && @1 == "futex" %?
> > [...]
> > However because && is not short circuiting in the preprocessor I have to
> > write [far more than any decent, patriotic human being should ever be
> > required to; even more than the penance little six-year-old Johnny
> > had to perform after teasing the neighbour's cat; oh dear, oh dear]
>
> Yeah, that's a bug: filed as http://sourceware.org/PR13655. It
> shouldn't be too hard to fix actually. It might just need an extra
> statement or two on line 588ish.
Right - in today's master branch at line 590, but remember you still
need to skip all the tokens until the %? somehow - and the obvious
solution (just skip them) doesn't validate the syntax of what's been
skipped. Thus making any parse error messages potentially depend on the
command line.
Andrew