automake error: Unescaped left brace in regex is deprecated

25,026

Solution 1

In perl v5.22, using a literal { in a regular expression was deprecated, and will emit a warning if it isn't escaped: \{. In v5.26, this won't just warn, it'll cause a syntax error.

The author of the software will need to fix this before the 5.26 release. For now, you can safely ignore this warning.

See perldelta for details.

Solution 2

This was fixed on 2016-04-01 (after automake 1.15, before 1.15.1).

From the ChangeLog:

  966 2016-04-01  Paul Eggert  <[email protected]>
  967 
  968   automake: port to Perl 5.22 and later
  969 
  970   Without this change, Perl 5.22 complains "Unescaped left brace in
  971   regex is deprecated" and this is planned to become a hard error in
  972   Perl 5.26.  See:
  973   http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
  974   * bin/automake.in (substitute_ac_subst_variables): Escape left brace.

Solution 3

This is due to the change described in "Perl Changes for 5.22" but the solution suggested there of escaping the '{' is frequently not the right thing to do, depending on the intended logic of the regex.

This warning occurs when a regex uses a construct like "{,20}" which historically in some OTHER regex implementations has been interpreted as equivalent to "{0,20}", i.e. "a repeating series of the preceding atom, zero to twenty times." In all cases where the intent is to quantify a repeat, this is broken in all modern versions of Perl, because interpretation of '{' followed by anything other than a number as a literal '{' has been explicitly documented since 5.8. Escaping the left brace in the case of an intended quantifier isn't the fix; adding the implied zero is.

Share:
25,026

Related videos on Youtube

ISlimani
Author by

ISlimani

Updated on September 18, 2022

Comments

  • ISlimani
    ISlimani over 1 year

    After compiling and installing GNU automake 1.15, I get this error whenever I run automake:

    Unescaped left brace in regex is deprecated, passed through in regex;
    marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/
    at /usr/local/bin/automake line 3936
    

    I am running perl v5.22.0.

    • Admin
      Admin over 6 years
      Problem seems to be fixes with automake 1.15.1
    • Admin
      Admin about 6 years
      This problem has cropped up in Creating config file /etc/logrotate.d/postgresql-common with new version Building PostgreSQL dictionaries from installed myspell/hunspell packages... en_us Removing obsolete dictionary files: Setting up postgresql-9.5 (9.5.11-0ubuntu0.16.04) ... Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78. Also because @bill-cole's answer is most relevant.