bug-make
[Top][All Lists]
Advanced

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

Weird text-dependent bug in $(eval ...), simple test case


From: Jamie Lokier
Subject: Weird text-dependent bug in $(eval ...), simple test case
Date: Wed, 10 Feb 2010 20:40:47 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

Dear Make maintainers,

Create a file called buggyMakefile with these two lines:

    CONFIGS := normal c99-pedantic c89-pedantic foobar baz
    $(foreach C,$(CONFIGS),$(eval $C $C/:;))

and then run "make -f buggyMakefile".

If you're using the same GNU Make 3.81 as me, it will greet you with
some surprising messages:

buggyMakefile:2: target `c99-pedantic' given more than once in the same rule.
buggyMakefile:2: target `foobar' given more than once in the same rule.
buggyMakefile:2: target `baz' given more than once in the same rule.
make: `normal' is up to date.

It's surprising because (a) there shouldn't be those "more than once"
messages at all (the forward-slash makes them different targets), and
(b) the messages are only produced for some words, not others.  It
depends on the words, not the order in the list.

It is dependent on the characters in the words.  If the words
"normal" and "c89-pedantic" are changed to something else, even with
the same length, they show up in the "more than once" errors.

This bug was found with the "make-3.81-6" package distributed with
32-bit x86 Ubuntu 9.10 (Karmic Koala), which should be plain GNU Make 3.81.
Output of "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 i486-pc-linux-gnu

Thanks,
-- Jamie




reply via email to

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