bugmake - Bugs: bug #17521, target-specific variables inluding...

 
 

bug #17521: target-specific variables inluding semicolon

Submitted by:  None
Submitted on:  Fri 25 Aug 2006 08:43:51 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.81Operating System: Any
Fixed Release: 3.82Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 08 Jun 2009 12:47:19 PM UTC, comment #4:

Fixed. Thanks.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 03 Feb 2009 04:22:09 PM UTC, comment #3:

escaping the "offending" semicolons with a backslash alleviates the problem, but remains a source of inconsistency and frustration.

Anonymous
Fri 25 Aug 2006 03:55:38 PM UTC, comment #2:

Actually, Eli, if the example shown is accurate (I haven't tried it) then this seems to be a bug. First note that the two cases behave differently: the one without the semicolon strips the backslash and the one with it does not. That can't be right.

Second, the text you're quoting applies to backslashes inside the command script: these backslashes are in variable values (even though they're target-specific variables they still follow the rules for setting variables) and the behavior of backslashes in variable values didn't change.

Again, I haven't looked at this at all but offhand I'd say there's some issue with the parser finding semicolons in target-specific variables: remember make needs to handle semicolons in a normal target definition such as "all: ; @echo all" specially.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 25 Aug 2006 01:05:44 PM UTC, comment #1:

This is not a bug, but a documented change in behavior, intended to bring GNU Make in line with Posix specification for Make.

From the NEWS file:

  • WARNING: Backward-incompatibility!

In order to comply with POSIX, the way in which GNU make processes
backslash-newline sequences in command strings has changed. If your
makefiles use backslash-newline sequences inside of single-quoted
strings in command scripts you will be impacted by this change. See
the GNU make manual subsection "Splitting Command Lines" (node
"Splitting Lines"), in section "Command Syntax", chapter "Writing the
Commands in Rules", for details.

In other words, your Makefile violates Posix rules for Make; in order to fix your Makefile, either use double quotes instead of single quotes, or put the single-quoted string into a Make variable and use that variable in rule's commands.

Eli Zaretskii <eliz>
Project Member
Fri 25 Aug 2006 08:43:51 AM UTC, original submission:

$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-cygwin
$
$ cat Makefile
test: HELLO = 'hello \
world'

test2: HELLO2 = 'hello; \
world'

test :
@echo $(HELLO)
test2 :
@echo $(HELLO2)

$ make test
hello world
$ make test2
hello; \
world
----------------

I expect 'hello; world'.

Regards.

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

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:19:47 AM UTCpsmithFixed Release4.0=>3.82
    Mon 08 Jun 2009 12:47:19 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Operating SystemMS Windows=>Any
      Fixed ReleaseNone=>4.0

    Back to the top


    Powered by Savane 3.1-cleanup1