bugmake - Bugs: bug #64402, error parsing functions in braces...

 
 

bug #64402: error parsing functions in braces inside ifeq, ifneq

Submitter:  None
Submitted:  Mon 10 Jul 2023 11:40:55 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.4 Operating System:  POSIX-Based
Fixed Release:  SCM Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 07 Jan 2024 03:27:36 PM UTC, comment #1: 

I fixed this.  Also commas used as variable names now work correctly.

As a side-effect, only parens or braces which are part of a variable reference are counted, so if you had something like this:


ifeq ((foo,bar),)


that is now a syntax error (of course it's find if you have a variable reference that expands to (foo,bar)).

Paul D. Smith <psmith>
Group administrator
Mon 10 Jul 2023 11:40:55 AM UTC, original submission:  

Per the GNU make manual, function call syntax is either
  $(function arguments)  # parenthesis
or
  ${function arguments}  # braces

Using braces in most cases works, however, using braces inside an `ifeq` or `ifneq` condition sometimes fails with:

* unterminated call to function 'join': missing '}'.  Stop.

It fails if the function is the 1st argument of the `ifeq`, and the function has multiple arguments (e.g., findstring). It works if the function is the 2nd argument of `ifeq`, or the function has only one argument (e.g., sort). Illustrative examples (more in attached Makefile):

```
#-------------------------------------------------------------------------------
ifeq ($(and a),)
endif

# ok
ifeq (${and a},)
endif

# ok
ifneq (,${and a})
endif

# ok
ifneq (${and a},)
endif

# ok
ifneq (,${and a})
endif

#-------------------------------------------------------------------------------
ifeq ($(and a, b),)
endif

# Makefile:469: * unterminated call to function 'and': missing '}'.  Stop.
## ifeq (${and a, b},)
## endif

# ok
ifneq (,${and a, b})
endif

# Makefile:477: * unterminated call to function 'and': missing '}'.  Stop.
## ifneq (${and a, b},)
## endif

# ok
ifneq (,${and a, b})
endif
```

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54917:  Makefile added by None (9KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-07 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone SCM
        Triage StatusNone Small Effort
    2023-07-10 None Attached File- Added Makefile, #54917

    Back to the top

    Powered by Savane 3.13-3e34.
    Corresponding source code