freebsd-src/cddl
Mark Johnston 4bddff0833 libdtrace: Work around a warning from flex
When compiling dt_lex.l, flex produces warnings of the form:

  dt_lex.l:413: warning, trailing context made variable due to preceding '|' action
  dt_lex.l:412: warning, dangerous trailing context
  dt_lex.l:412: warning, dangerous trailing context

Here, trailing context refers to the use of "$", which expands to "/\n".

The meaning behind these warnings is described in the first two
paragraphs of the flex manual's DEFICIENCIES/BUGS section:

  Some trailing context patterns cannot be properly matched and generate
  warning messages ("dangerous trailing context").  These are patterns
  where the ending of the first part of the rule matches the beginning of
  the second part, such as "zx*/xy*", where the 'x*' matches the 'x' at
  the beginning of the trailing context.  (Note that the POSIX draft
  states that the text matched by such patterns is undefined.)

  For some trailing context rules, parts which are actually fixed-length
  are not recognized as such, leading to the above mentioned performance
  loss.  In particular, parts using '|' or {n} (such as "foo{3}") are
  always considered variable-length.

Here, the warnings appear to be bogus in this case.  The lexer has no
problem matching either of the referenced patterns, e.g.,

  printf("foobar

or

  # 1 "asdfasdf

Introduce a small amount of code duplication to silence the warning.

MFC after:	2 weeks
2024-06-01 11:16:26 -04:00
..
compat/opensolaris Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
contrib/opensolaris libdtrace: Work around a warning from flex 2024-06-01 11:16:26 -04:00
lib zfs: merge openzfs/zfs@e2357561b 2024-05-31 11:26:50 +02:00
sbin Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
share zfs: update share/zfs/compatibility.d to match current ZFS code 2023-09-22 01:37:38 +02:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
usr.bin Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
usr.libexec zfsbootcfg(8), zpool_influxdb(8): move to the zfs package 2024-04-22 23:04:03 -06:00
usr.sbin zfsd: fix unit tests after 89f4f91dbf 2024-04-12 18:34:23 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00