[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change of behavior: 3.80 vs 3.81beta3 WRT line continuation
From: |
Steve James |
Subject: |
Re: Change of behavior: 3.80 vs 3.81beta3 WRT line continuation |
Date: |
Mon, 22 Aug 2005 14:25:49 +0100 |
User-agent: |
KMail/1.7.2 |
Paul, thanks for your reply on this.
I had seen the note in NEWS and I had re-read the latest make.info section
Command Execution too. Honest! However, I still couldn't be sure if this was
a bug. I suggest that the nature of this incompatibility is described in the
manual (or at least the NEWS). I for one could do with some advice on what to
do about all my make scripts that use the following idiom. I use this a lot.
ascript :
@ echo -e \
'line1\n\
line2\n\
line3' > $@
I also do this kind of thing a lot:
perl.out : x.pm
@ perl -Mx -e '\
$$this = q/that/; \
do { \
something($$this); \
} or $$not; \
' > $@
Can you recommend how to write these in a way that's compatible with both 3.80
and 3.81? Perhaps I'd get more mileage with double-quotes? Or perhaps I
should use 'define'?
Cheers,
Steve.
On Sunday 21 August 2005 23:28, Paul D. Smith wrote:
> %% Steve James <address@hidden> writes:
>
> sj> AFAICT the behavior of line continuation escapes has changed
> sj> within single-quoted strings. What's really confusing me is that
> sj> this seems to be deliberate.
>
> Yes, you're right on all counts. So.... what's confusing? :-)
>
> sj> all:
> sj> @echo 'line1\
> sj> line2'
>
> sj> Version 3.80 prints this (as I would expect):
> sj> line1line2
>
> You may expect that because that's what make has printed in the past,
> but that's not the correct result according to the POSIX definition of
> make.
>
> Please see the NEWS file, or the GNU make manual (the version provided
> with beta3 of course).
>
> sj> But Version 3.80beta3 prints this:
> sj> line1\
> sj> line2
>
> This is correct.
>
> sj> There's some background to this change concerning POSIX (Savannah
> sj> bug # 1332).
>
> Right. Did you look up that bug and the accompanying commentary on
> Savannah?
>
> sj> See, entirely deliberate. What's more the regression tests in
> sj> tests/scripts/misc/general3 verify this behavior. But this all
> sj> looks broken to me.
>
> Why does it look broken? Run the same command in a (POSIX) shell and
> you'll get the new behavior, not the old behavior:
>
> $ echo 'line1\
>
> > line2'
>
> line1\
> line2
>
> So, why is it broken that when make invokes a shell to run that same
> command you get the same result?
>
> sj> So what's up? Is this
> sj> 1. A new bug in the beta,
>
> No.
>
> sj> 2. A deliberate non-backward compatibility
>
> Yes... it's a change that was made so that GNU make would conform to the
> POSIX specification for make. Unfortunately, that involves an
> incompatibility.
>
> Again, the NEWS file has info about this and other user-visible changes;
> it should always be the first place you look when upgrading versions of
> GNU make.
--
All power corrupts, but we need electricity.