bugmake - Bugs: bug #51297, Better support for escaping of...


bug #51297: Better support for escaping of function parameters

Submitted by:  Markus Elfring <elfring>
Submitted on:  Fri 23 Jun 2017 10:11:01 AM UTC  
Severity:  3 - Normal Item Group:  Enhancement
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  Any
Fixed Release:  None Triage Status:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 02 Jul 2017 05:13:34 PM UTC, comment #1: 

It's important to understand that in GNU make (unlike the shell, for example) splitting of arguments in function invocations is done before the arguments are expanded.

So, you don't have to worry about special characters embedded in variables making a hash of your expansion.  If they're not present directly in the call, they're not special.

So for example, this works fine:

foo = abcd, 234, (fo"o), bar'))

show = 1: |$1|

$(info $(call show,$(foo)))

will show:

1: |abcd, 234, (fo"o), bar'))|

This is true of all make functions that take arguments.  As a result there's very little reason to need something that will escape a string, to keep it from being interpreted by make functions.

It is useful to be able to escape whitespace and some other characters, in some contexts (but this is NOT needed to delimit arguments to make functions).  But that's bug #712 as already noted, so we don't need another bug for this.

Paul D. Smith <psmith>
Project Administrator
Fri 23 Jun 2017 10:11:01 AM UTC, original submission:  

The make software supports also calling functions. The handling of corresponding arguments is described a bit. A few characters are mentioned which have got a special meaning within the language that is used by the tool “make”.

I am also especially interested in the clarification under which circumstances a passed text should be treated as a single argument (or it will be processed as separate parameters as usual according to the syntax). The functionality “word splitting” can occasionally trigger special software development challenges.
I see a need to support safer data processing there.

  • Escape a string by a corresponding function call so that it is reusable as a single parameter.
  • Provide another function call which can perform the opposite transformation so that a value is split into smaller items.

How do you think about to add extra support for such data conversion in the make function library?

Markus Elfring <elfring>


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

Attach Files:

No files currently attached


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)
  • -email is unavailable- added by elfring (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-02 psmith StatusNone => Duplicate
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5