URL:
  <https://savannah.gnu.org/support/?111221>

                 Summary: _AC_DEFINE_UNQUOTED has broken regex
                   Group: Autoconf
               Submitter: ericb
               Submitted: Mon 07 Apr 2025 10:48:46 AM CDT
                Priority: 5 - Unprioritized
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 07 Apr 2025 10:48:46 AM CDT By: Eric Blake <ericb>
Captured from https://lists.gnu.org/archive/html/bug-m4/2025-04/msg00027.html.
It looks like the existing regex of _AC_DEFINE_UNQUOTED searches for the
literal 8-byte string "(|{|@S|@" when it really wanted to search for the
alternation of any of the following three strings "(" "{" "@S|@".


lib/autoconf/general.m4:[m4_if(m4_bregexp([$1],
[#\|\\\|`\|\(\$\|@S|@\)\((|{|@{:@\)]), [-1],

in the definition of _AC_DEFINE_UNQUOTED.  That regex is asking for a
literal "#", "\", "`", or the concatenation of [either "$" or the
quadrigraph "@S|@" (an alias for "$")] with [literal "(|{|"
concatenated with the quadrigraph @{:@ (for "(")].  Despite my HUH[*]?
factor, this appears to WANT to match a "{" as a literal, at any rate,
since it is using bare "{" with the next byte neither a digit nor ",",
it would break if we turn on "{}" for intervals by default.

[*]At any rate, I think that's a bug in autoconf (hence why I added
them in cc).  If the _intent_ was to match literal "#", "\", "`", and
the sequences "$(" and "${" (either as literals or via quadrigraphs),
it isn't quite doing that.  The correct spelling (with added
whitespace for clarity, although the whitespace would not be part of
the regex) would be

[ # \| \\ \| ` \| \( \$ \| @S|@ \) \( | \| { \| @{:@ \) ]










    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111221>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to