unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#35427: Conflicting declarations of GC_is_heap_ptr
@ 2019-04-25  6:20 Sören Jonsson
  2019-04-30 15:32 ` bug#35427: Problem solved Sören Jonsson
  0 siblings, 1 reply; 2+ messages in thread
From: Sören Jonsson @ 2019-04-25  6:20 UTC (permalink / raw)
  To: 35427

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]


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


[-- Attachment #2: Type: text/html, Size: 2852 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#35427: Problem solved
  2019-04-25  6:20 bug#35427: Conflicting declarations of GC_is_heap_ptr Sören Jonsson
@ 2019-04-30 15:32 ` Sören Jonsson
  0 siblings, 0 replies; 2+ messages in thread
From: Sören Jonsson @ 2019-04-30 15:32 UTC (permalink / raw)
  To: 35427

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]


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


[-- Attachment #2: Type: text/html, Size: 889 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-30 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-25  6:20 bug#35427: Conflicting declarations of GC_is_heap_ptr Sören Jonsson
2019-04-30 15:32 ` bug#35427: Problem solved Sören Jonsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).