On Sun, 30 Nov 2014, Benny Pedersen wrote:

On 30. nov. 2014 20.53.19 John Hardin <jhar...@impsec.org> wrote:

 Sadly that doesn't work. The else branch of a conditional still gets
 partially parsed, so the perl_version type warning is still emitted even
 if it is inside a conditional that evaluates to false.

 Try this:

 if 0 > 0

Psudo if trunc

Huh?

    if fnord > 0

Psudo fnord would exists in trunc

This has nothing to do with trunk code, if that's what you're suggesting. I'm illustrating the behavior of parsing vs. conditionals with something that will generate a warning simliar to what we're seeing with perl_version. Did you actually *try* what I suggested?

      meta SYN_ERROR
    endif
 endif

 SA won't generate a warning about the syntax of the SYN_ERROR rule, but it
 will emit a warning about fnord not being numeric.

Not if trunc installed, hopefully,

I tested the above against trunk before recommending you try it.

is it a svn tag check in sa ?

No. "fnord" is just a token that I know will not match anything in conditional parsing, even in trunk. It's a guaranteed parse warning. Sorry, I meant to use "fnord" literally to illustrate the problem, not as a generic placeholder.

Hopefully it would be resolved in future sa verions to not break any admin legs :)

It's possible that the parser could be revised to not parse false conditional branches as much as it is, but that would *not* correct this behavior in existing releases so doing this won't succeed in preventing these warnings in older SA when a new release that supports perl_version goes out:

  if release > 3.004001
    if perl_version >= 5.010000
      body NON_588_COMPATIBLE_RE_SYNTAX /\w++/
    endif
  endif

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhar...@impsec.org    FALaholic #11174     pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
 15 days until Bill of Rights day

Reply via email to