bugmake - Bugs: bug #1454, $(if ) cannot parse semi-colons...

 
 

bug #1454: $(if ) cannot parse semi-colons inside arguments

Submitter:  Invalid User ID <#11708>
Submitted:  Sat 19 Oct 2002 07:43:46 AM UTC
   
 
Severity:  1 - Wish Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  None Operating System:  Any
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 25 Jun 2005 09:32:10 PM UTC, comment #3: 

OK, this is fixed for the next version of GNU make.  When a variable or function reference appears on a target definition line, no semicolons (or comment chars, #) inside the reference will be treated specially.

Paul D. Smith <psmith>
Group administrator
Tue 11 Mar 2003 09:11:46 AM UTC, comment #2: 

It works in an assignment though:

 a:=$(if true,$(shell echo hi; echo bye))

Robert Bogomip <bobbogo>
Fri 25 Oct 2002 08:38:01 PM UTC, comment #1: 

The real issue here is that make sees the semicolon as a part of a target definition, like this:

  all: ; @echo hi

Instead of noticing that the semicolon is contained within a variable reference, if it appears on the context where it could be a target definition make treats it as the end of the target definition.

Note this won't happen in other contexts, like variable assignement, where make doesn't treat ";" as a special character.  Since $(shell ...) is almost always used in a variable assignment context (the above makefile, even if it didn't cause this error, would still result in a syntax error) this hasn't been noticed before.

A workaround would be to hide the semicolon in a variable reference:

  SEMI = ;
  $(if true, $(shell echo hi $(SEMI) echo bye))

Paul D. Smith <psmith>
Group administrator
Sat 19 Oct 2002 07:43:46 AM UTC, original submission:  

Example makefile:
$(if true, $(shell echo hi; echo bye ) )
--- Error message:
Makefile:3: * unterminated call to function `if': missing `)'.  Stop.

Invalid User ID <#11708>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2005-06-25 psmith Open/ClosedOpen Closed
    Fixed ReleaseNone 4.0
2005-06-25 psmith StatusNone Fixed
2002-10-25 psmith Severity3 - Normal None
    Item GroupNone None
    Assigned toNone None
    Operating SystemNone None

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code