unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Sören Jonsson" <sorjon02@gmail.com>
To: 35427@debbugs.gnu.org
Subject: bug#35427: Conflicting declarations of GC_is_heap_ptr
Date: Thu, 25 Apr 2019 08:20:31 +0200	[thread overview]
Message-ID: <e184bf44-2c7a-2bd8-e640-a980a40e1c64@gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2019-04-25  6:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25  6:20 Sören Jonsson [this message]
2019-04-30 15:32 ` bug#35427: Problem solved Sören Jonsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e184bf44-2c7a-2bd8-e640-a980a40e1c64@gmail.com \
    --to=sorjon02@gmail.com \
    --cc=35427@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).