bugmake - Bugs: bug #16670, Repeated backslash-escaped...

 
 

bug #16670: Repeated backslash-escaped newlines not POSIXly replaced

Submitted by:  Ray Ingles <sorceror>
Submitted on:  Wed 24 May 2006 01:56:09 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.81Operating System: POSIX-Based
Fixed Release: 4.0Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 03 Mar 2012 06:53:16 PM UTC, comment #3:

I modified the .POSIX pseudo target behavior so that if it's set, then we get POSIX-style backslash/newline handling. The default, though, remains the GNU make method.

If you want to portably get the POSIX behavior without specifying .POSIX, you can do this:

That is, add empty variable references so that the parser doesn't think that the backslash/newlines are really consecutive, and that the whitespace is not trailing.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 02 Jun 2009 02:24:45 PM UTC, comment #2:

Ugh. Savannah's comments kind of suck. I mean, the current behavior gives:

and the POSIXly-correct behavior would give:

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 02 Jun 2009 02:23:06 PM UTC, comment #1:

OK, the fix for this is simple enough. However, it does cause user-visible changes. It's not so much the replacing of each backslash/newline/following whitespace with a space that's the issue, it's the fact that TRAILING whitespace on the previous line is no longer condensed. The current behavior basically condenses ALL whitespace starting with the last non-whitespace character on the previous line and going until the next non-whitespace character (where backslash/newline are considered whitespace) and replaces it with a single space. So, in the current version of make this:
Gives a value of $(FOO) that is "a b". In the new behavior this would give "a b", because the trailing whitespace on the previous line is preserved, plus one extra space for the backslash/newline/following whitespace.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Wed 24 May 2006 01:56:09 PM UTC, original submission:

According to POSIX, each escaped newline (newline preceeded by a backslash) is supposed to be replaced with a single space when not in a command. However, sequential escaped newlines are replaced by only a single space. The attached makefile illustrates the problem.

Ray Ingles <sorceror>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #10043:  makefile added by sorceror (38B - application/octet-stream - Makefile illustrating repeated escaped newlines replaced with single space.)

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 03 Mar 2012 06:53:16 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
    Wed 24 May 2006 01:56:09 PM UTCsorcerorAttached File-=>Added makefile, #10043

    Back to the top


    Powered by Savane 3.1-cleanup1