On Wed, Sep 21, 2011 at 10:43:20AM +0800, Michael W. Bombardieri wrote:
> Hi all,
> 
> I noticed that the make(1) build is broken for non-gcc compilers.
> The following diff stops the build from breaking for pcc and llvm/clang.
> Comments?

It effectively negates the inline optimisation when Targ_FindNodeh is
used in parse.c. I suggested the following diff to espie@ a while ago
(tested with gcc4, pcc and clang):



Index: targ.c
===================================================================
RCS file: /cvs/src/usr.bin/make/targ.c,v
retrieving revision 1.62
diff -u -r1.62 targ.c
--- targ.c      19 Jul 2010 19:46:44 -0000      1.62
+++ targ.c      21 Sep 2011 09:35:31 -0000
@@ -461,9 +461,3 @@
 {
        return &targets;
 }
-
-GNode *
-Targ_FindNodeh(const char *name, size_t n, uint32_t hv, int flags)
-{
-       return Targ_FindNodeih(name, name + n - 1, hv, flags);
-}
Index: targ.h
===================================================================
RCS file: /cvs/src/usr.bin/make/targ.h,v
retrieving revision 1.9
diff -u -r1.9 targ.h
--- targ.h      19 Jul 2010 19:46:44 -0000      1.9
+++ targ.h      21 Sep 2011 09:35:31 -0000
@@ -56,9 +56,9 @@
 /* set of helpers for constant nodes */
 extern GNode *Targ_FindNodeih(const char *, const char *, uint32_t, int);
 
-extern inline GNode *
+static inline GNode *
 Targ_FindNodeh(const char *, size_t, uint32_t, int);
-extern inline GNode *
+static inline GNode *
 Targ_FindNodeh(const char *name, size_t n, uint32_t hv, int flags)
 {
        return Targ_FindNodeih(name, name + n - 1, hv, flags);

Reply via email to