bugmake - Bugs: bug #18561, Why backslash line continuation...

 
 

bug #18561: Why backslash line continuation introduce an extra space

Submitted by:  None
Submitted on:  Wed 20 Dec 2006 05:32:28 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 29 Jan 2007 04:07:49 PM UTC, comment #1:

It is by design; in fact it's mandated by the POSIX standard for make, which states:

> When an escaped <newline> (one preceded by a backslash) is found
> anywhere in the makefile except in a command line, it shall be
> replaced, along with any leading white space on the following
> line, with a single <space>.


Since there is no limit to the length of a physical line in a makefile in GNU make, I suggest you only break physical lines at whitespace.

Paul D. Smith <psmith>
Project Administrator
Wed 20 Dec 2006 05:32:28 AM UTC, original submission:

For GNUmake 3.81 and 3.80:

For a makefile like this:

{code}
nlap = a\n\
b

$(warning $(nlap))

nlappend:
echo -e "$(nlap)" > out.dat
{code}

The generated out.dat has the following content(represented in hex):

========
61 0A 20 62 0A
========

You can see a space introduced in the value of `nlap'. Is this by design? I hope it's not -- but a bug, since the user wants only line-continuation, not an extra space. If he wants an extra space, he can add it himself.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 29 Jan 2007 04:07:49 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1