[bug #51297] Better support for escaping of function parameters

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #51297] Better support for escaping of function parameters

Robert Morell
URL:
  <http://savannah.gnu.org/bugs/?51297>

                 Summary: Better support for escaping of function parameters
                 Project: make
            Submitted by: elfring
            Submitted on: Fri 23 Jun 2017 12:11:01 PM CEST
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.2.1
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

The make software supports also calling functions
<https://www.gnu.org/software/make/manual/html_node/Syntax-of-Functions.html>.
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 <https://savannah.gnu.org/bugs/?712>.
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?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51297>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #51297] Better support for escaping of function parameters

Robert Morell
Update of bug #51297 (project make):

                  Status:                    None => Duplicate              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up 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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51297>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Loading...