bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59395] gmake space handling is not compatible to POSIX


From: Paul D. Smith
Subject: [bug #59395] gmake space handling is not compatible to POSIX
Date: Tue, 1 Dec 2020 13:07:57 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Follow-up Comment #3, bug #59395 (project make):

> Could you explain why gmake deviates from make in such an important point?

Is it important though?  What makefiles really care?  If it were critical then
there would certainly be a lot of people upset about this but it seems like it
only matters for the letter of the standard, not for any practical use.

The reason GNU make handles backslash/newline this way is lost in the mists of
time so I cannot help you understand why it was done.  Most likely Richard and
Roland just thought automatically condensing newlines was better / more
user-friendly.  Their goal (AIUI) was not to perfectly emulate any other
implementation of make: they wanted to create a make that worked best for them
and their users.

Once the choice was made, and was in effect for a lot of years, there were
potentially a lot of makefiles that assumed that whitespace was condensed
(when showing output etc.) and it didn't seem important enough an issue to
break backward-compatibility so when the POSIX discrepancy was pointed out I
fixed it by changing it for .POSIX only.

The way it *should* have worked is to replace backslash/newline with *ZERO*
characters.  That would have actually been a useful distinction because it
would have allowed concatenation of text across lines (for formatting purposes
in the makefile) without forcing spaces in them.  If you wanted a space you'd
just include one before the backslash or after the newline, which almost
everyone does anyway.  Once the opportunity to do it the right way was lost it
seems fairly arbitrary whether you use one space per newline or collapse them
into a single space.  In fact, the ONLY request I consistently get regarding
handling of backslash/newline is how to avoid putting any spaces at all.  No
one seems to care whether you get one space per newline or not.

> I believe that .POSIX should be reserved to cases where the POSIX standard
does not agree with the behavior of the historic UNIX make.

I disagree with this interpretation of the purpose of .POSIX and see no
justification for such an interpretation in the standard.  Its purpose is
exactly what GNU make uses it for: to ensure that makefiles written to conform
to the POSIX standard will work properly when run with a given make
implementation.  Nothing more nor less.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59395>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]