Bug 35061 - makedepend cannot handle include files a/foo.h and b/foo.h
Summary: makedepend cannot handle include files a/foo.h and b/foo.h
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Build/Monolithic (show other bugs)
Version: 7.4 (2008.09)
Hardware: All Linux (All)
: lowest normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard: 2011BRB_Reviewed
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-06 07:37 UTC by Jörgen Grahn
Modified: 2018-06-12 19:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Jörgen Grahn 2011-03-06 07:37:01 UTC
I reported this as http://bugs.debian.org/584281 back in June,
but only recently got the advice to report it upstream instead.
I'll just quote my original description:

If you let makedepend generate dependencies for multiple .c files in
different directories, and two of them do

  #include "foo.h"

and expect that to mean the foo.h which is in the same directory as
the source file, makedepend will pick one of the foo.h files (and
whatever it includes) and apply as dependencies to both .c files.

To see the problem, do:

mkdir a b
echo '#include "foo.h"' > a/foo.c
echo '#include "foo.h"' > b/foo.c
echo '#include <stdlib.h>' > a/foo.h
echo '#include <stdlib.h>' > b/foo.h
makedepend -f - ?/foo.c

You will see among other things these two dependencies:
a/foo.o: a/foo.h
b/foo.o: a/foo.h # incorrect; should be b/foo.h

This bug seems to exist in all makedepends I have tried. I suppose it
comes from the optimizations mentioned in the manual page. I really
don't like it, because it will silently generate Makefiles with bogus
dependency graphs in them for what (to me at least) looks like pretty
normal source code. Such Makefiles are dangerous -- especially when
you trust them, because you let the standard tool makedepend generate
them.

If it cannot be fixed, this bug should be mentioned in the makedepend(1)
man page.
Comment 1 Adam Jackson 2018-06-12 19:09:13 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.