GNU bug report logs - #35427
Conflicting declarations of GC_is_heap_ptr

Previous Next

Package: guile;

Reported by: Sören Jonsson <sorjon02 <at> gmail.com>

Date: Thu, 25 Apr 2019 14:25:01 UTC

Severity: normal

To reply to this bug, email your comments to 35427 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#35427; Package guile. (Thu, 25 Apr 2019 14:25:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sören Jonsson <sorjon02 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 25 Apr 2019 14:25:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sören Jonsson <sorjon02 <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: Conflicting declarations of GC_is_heap_ptr
Date: Thu, 25 Apr 2019 08:20:31 +0200
[Message part 1 (text/plain, inline)]
Hello,

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.

Environment:

   Cygwin

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

   guile-2.2.4

   gc-8.0.4

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'

Analysis:

   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Å
SWEDEN
Tel: 090-180 339, 070-603 3896

[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#35427; Package guile. (Tue, 30 Apr 2019 15:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 35427 <at> debbugs.gnu.org (full text, mbox):

From: Sören Jonsson <sorjon02 <at> gmail.com>
To: 35427 <at> debbugs.gnu.org
Subject: Problem solved
Date: Tue, 30 Apr 2019 17:32:59 +0200
[Message part 1 (text/plain, inline)]
Hello,

By examining the code in both /usr/local/include/gc.h and 
libguile/pairs.h I managed to resolve the problems.

I did this by adding two lines to gc.h, at the top of the file.

   #define HAVE_GC_IS_HEAP_PTR              // OSJ
   #define HAVE_GC_MOVE_DISAPPEARING_LINK   // OSJ

This is maybe not your preffered solution, but I managed to compile and 
link the libraries and programs. Hopefully this helps you.

Best regards,

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

[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 45 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.