[Top][All Lists]

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

bug#35427: Conflicting declarations of GC_is_heap_ptr

From: Sören Jonsson
Subject: bug#35427: Conflicting declarations of GC_is_heap_ptr
Date: Thu, 25 Apr 2019 08:20:31 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1


I'm working on building guile 2.2.4 for Cygwin/Windows. I have now resolved a couple of library issues, and have run into a problem with conflicting declarations.



$ gcc --version
gcc (GCC) 7.4.0
Copyright © 2017 Free Software Foundation, Inc.



Error message:

make  all-am
make[3]: Entering directory '/tmp/guile-2.2.4/libguile'
  CC       guile-guile.o
In file included from ../libguile.h:81:0,
                 from guile.c:34:
../libguile/pairs.h:182:1: error: conflicting types for 'GC_is_heap_ptr'
 GC_is_heap_ptr (void *ptr)
In file included from ../libguile/bdw-gc.h:47:0,
                 from ../libguile/gc.h:156,
                 from ../libguile/atomic.h:25,
                 from ../libguile.h:37,
                 from guile.c:34:
/usr/local/include/gc/gc.h:551:20: note: previous declaration of 'GC_is_heap_ptr' was here
 GC_API int GC_CALL GC_is_heap_ptr(const void *);
make[3]: *** [Makefile:3575: guile-guile.o] Error 1
make[3]: Leaving directory '/tmp/guile-2.2.4/libguile'


This appears to be a simple problem with the the function GC_is_heap_ptr declared in two different ways in two different files: /usr/local/include/gc/gc.h.156 and /tmp/guile/2.2.4/libguile/pairs.h. The first file declares it as "GC_API int GC_CALL GC_is_heap_ptr(const void *);", and the second as "static int
GC_is_heap_ptr (void *ptr)
  return GC_base (ptr) != NULL;

Proposed solution:

The obvious solution would be to surround the definition in libguile/pairs.h with a conditional #ifndef HAVE_GC_IS_HEAP_PTR, but i get the impression that libguile/pairs.h is auto-generated, so I might brake your code.  What would be your preferred solution?

With my best regards,

Sören Jonsson
Kärnvägen 237
906 27 UMEÅ
Tel: 090-180 339, 070-603 3896

reply via email to

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