Re: [PATCH] commit-reach: correct accidental #include of C file

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

 



On 8/28/2018 5:36 PM, Jonathan Nieder wrote:
Without this change, the build breaks with clang:
For some reason, it didn't fail with GCC for me, but this is an obviously correct change to make. Thanks!
  libgit/ref-filter.pic.o: multiple definition of 'filter_refs'
  libgit/commit-reach.pic.o: previous definition here

Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
Jonathan Nieder wrote:
Derrick Stolee wrote:
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -1,8 +1,10 @@
  #include "cache.h"
  #include "commit.h"
+#include "commit-graph.h"
  #include "decorate.h"
  #include "prio-queue.h"
  #include "tree.h"
+#include "ref-filter.c"
Did you mean "ref-filter.h"?

This broke the build here.  Is there some check that we can use to
prevent it happening again?  I don't think we ever intentionally
#include a .c file.
Here's what I'm applying locally.

Thanks,
Jonathan

  commit-reach.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commit-reach.c b/commit-reach.c
index c996524032..86715c103c 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -4,7 +4,7 @@
  #include "decorate.h"
  #include "prio-queue.h"
  #include "tree.h"
-#include "ref-filter.c"
+#include "ref-filter.h"
  #include "revision.h"
  #include "tag.h"
  #include "commit-reach.h"



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux