From unknown Sat Jun 14 00:07:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35427 <35427@debbugs.gnu.org> To: bug#35427 <35427@debbugs.gnu.org> Subject: Status: Conflicting declarations of GC_is_heap_ptr Reply-To: bug#35427 <35427@debbugs.gnu.org> Date: Sat, 14 Jun 2025 07:07:02 +0000 retitle 35427 Conflicting declarations of GC_is_heap_ptr reassign 35427 guile submitter 35427 S=C3=B6ren Jonsson severity 35427 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 10:24:09 2019 Received: (at submit) by debbugs.gnu.org; 25 Apr 2019 14:24:10 +0000 Received: from localhost ([127.0.0.1]:59068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJfIH-0004fk-Dt for submit@debbugs.gnu.org; Thu, 25 Apr 2019 10:24:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJXm4-0007gf-Ak for submit@debbugs.gnu.org; Thu, 25 Apr 2019 02:22:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:33381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJXly-0000oy-My for submit@debbugs.gnu.org; Thu, 25 Apr 2019 02:22:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJXlx-0000TX-GJ for bug-guile@gnu.org; Thu, 25 Apr 2019 02:22:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJXlv-0000mS-TD for bug-guile@gnu.org; Thu, 25 Apr 2019 02:22:17 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:35611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJXlv-0000jP-98 for bug-guile@gnu.org; Thu, 25 Apr 2019 02:22:15 -0400 Received: by mail-lj1-x231.google.com with SMTP id z26so1351463ljj.2 for ; Wed, 24 Apr 2019 23:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=lLu6Z6Mr7foO3TkBG5TDbjQg+9qyUzK9c0+2GXaEimc=; b=fI2wlvsKRCIdUiW744eunJARNoHHMeZ5LxQ015nTHN0KCxullE2HUyHpfjblT2xAzL 56jtYxuJZRcVUmWphKUAQOJrBlXezFWjJT4EX9wmnXXYRlHFczXwATOZdbi7ZVkmiVb2 KLR1tJfL00ivLUQ2VfQT0UX9samAUjsNGTfOpV83AFLeZwhgLmBf0f+EdERheDmYLbwt i+EUmCRqfKbNaFtu+6u9gT5JwSl5MOfFx3MnpPU49mvn9Pagd3mh6jIHoEKFEHfo955h AfnxlBKQBhfLNInxbvO6Amb7VGg8+drhWuVhtcdHPeQmfJyLjp+OyCspklSEZ1HiuWI5 61xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=lLu6Z6Mr7foO3TkBG5TDbjQg+9qyUzK9c0+2GXaEimc=; b=j9QNhmDhm+ITnrpvTRWL09Ig9Gblf6FNbFlSGxpZ64s0NrF/CHAW9tiOrQj/42nbTH TWT9/kFmd2bRzupsF7ZJBSnnhR/bQ45hYvIN0GN7+4aWMjrxx0WweIVMoreiRuTly4hA lNHDi3a+mOAabFoVqyR/ONy3TFtZaBo7dmbbqI7QK49QWAGiX4waJTe4/HxRkMVIlIYL BCEpydHpe4oJ4I8oGxJHgO+8dWocADt0LHfBjUbvTPEqzqDhOmA6j+IhIl2VeG/sgXt2 HqpEgHwWqzh+lc82NSnrc++/2bxCq3H5b3f8DIpccLt4Z2WOGKTOiSv9nGjaycO+f/Q+ 4ezQ== X-Gm-Message-State: APjAAAWYCf8bDotcTABDlC7LQMq5Til67vAx7puPNWFroO0sUnKGaL5r ugge2JUZGqVVXrMQWpyxKfnADyLy X-Google-Smtp-Source: APXvYqzNbSUgyJnCsa00/zwjc3eC11NdAc2+TPyGmbpmT1bqr/2H0myvjPdU0h/ECN6QlaAFbbj8YQ== X-Received: by 2002:a2e:2a03:: with SMTP id q3mr19363561ljq.56.1556173329232; Wed, 24 Apr 2019 23:22:09 -0700 (PDT) Received: from [192.168.1.136] (31-208-200-56.cust.bredband2.com. [31.208.200.56]) by smtp.gmail.com with ESMTPSA id j24sm2057612lfh.28.2019.04.24.23.20.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 23:22:08 -0700 (PDT) To: bug-guile@gnu.org From: =?UTF-8?Q?S=c3=b6ren_Jonsson?= Subject: Conflicting declarations of GC_is_heap_ptr Message-ID: 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 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------33F034C29E9BDD08A641B3FB" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::231 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 25 Apr 2019 10:24:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) This is a multi-part message in MIME format. --------------33F034C29E9BDD08A641B3FB Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit 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 --------------33F034C29E9BDD08A641B3FB Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit


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
--------------33F034C29E9BDD08A641B3FB-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 30 11:58:31 2019 Received: (at 35427) by debbugs.gnu.org; 30 Apr 2019 15:58:31 +0000 Received: from localhost ([127.0.0.1]:42234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLV9L-0002ip-7H for submit@debbugs.gnu.org; Tue, 30 Apr 2019 11:58:31 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:44706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLUkv-000220-D2 for 35427@debbugs.gnu.org; Tue, 30 Apr 2019 11:33:17 -0400 Received: by mail-lf1-f41.google.com with SMTP id h18so11055577lfj.11 for <35427@debbugs.gnu.org>; Tue, 30 Apr 2019 08:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=VmljAoW2GHTm1E9Q+HM+GGVXhuEiZunpJCpLYrkEuVc=; b=nb5kQ/tXNgaHw6FC3r2walvY36wx9hyjIqw8D/+akXP0ryi2ALAFExSKJmOwTcTlKl h1tVHWogzY+1Yvd8LYUPBoPcHHxh1tewssxWzzgsgFvyy85bTe6j5JIwoGrPKF75BPlB /AhQjKbtN3swt2efXCcoNhsJN7kY6baLeDeYxhaYI9UbD2fFzP+kTP6MW7Lp1iRdKkdE L26ZbZuG1PUj84pwK3ibkM0e1N4y4PNEADIHkhmcwWDuQZBUZW3wWMdEBnFf+298Ach3 PNR7gOpySkNy6zHoBV+i3n3Z9/NuXVWJCxmgMvW4hspxrmvrBnjQD3TjoNXUIgdQhIrU eY1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=VmljAoW2GHTm1E9Q+HM+GGVXhuEiZunpJCpLYrkEuVc=; b=afhj3T/sEMkUhLwVkpGDiA5p8Y1wTy6tywT3/Lmtgadz/YUmwMDR23TkHzFxgZlAFQ 6N3eco37x4ypG2HdDjzgr3ancSZ0zyH8aPJvo6Ud8b2X0twXQ1ZvUR5xtli485WJnzTY 8NmKPLvrEYCsDequMTu6XXmppQWHWqaq6Kr+iUxALI2QCltlQ/DWKlfhQ6GeXdnNTZf/ 0PUnUlddwcwhkL5QNABFbvZdmniIkb8R4x77Cc81mQ4cSt2Bm+6JTUFoVUkebDBr6tGu F+UGHxDRPgJz8SnfCUGram3rInRwxwVgLlEZKoZLSEKymoiQrnQ9DOt5LeDqnMHgbavr aqGQ== X-Gm-Message-State: APjAAAUmWTTemu4bvQx5KjoV9aaR2GUDuaea0vIHzxAkPxVTboqO/foC Qd7a50pGv7RFhNISEeipeAXTtdub X-Google-Smtp-Source: APXvYqybeznCR4AZUIw4ZB5xFcVeYDXRB6EGFarppdCFbx7WDaESMoBFBoQiQpBChLYf3WPAHs2fHw== X-Received: by 2002:a19:e01b:: with SMTP id x27mr610967lfg.14.1556638390931; Tue, 30 Apr 2019 08:33:10 -0700 (PDT) Received: from [192.168.1.136] (31-208-200-56.cust.bredband2.com. [31.208.200.56]) by smtp.gmail.com with ESMTPSA id g6sm7514165lja.64.2019.04.30.08.33.10 for <35427@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 08:33:10 -0700 (PDT) To: 35427@debbugs.gnu.org From: =?UTF-8?Q?S=c3=b6ren_Jonsson?= Subject: Problem solved Message-ID: <13ff1a43-da8f-87aa-9fcd-d24147dde805@gmail.com> Date: Tue, 30 Apr 2019 17:32:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------E5A49E9E1F8AD6622815A742" Content-Language: sv X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35427 X-Mailman-Approved-At: Tue, 30 Apr 2019 11:58:27 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) This is a multi-part message in MIME format. --------------E5A49E9E1F8AD6622815A742 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit 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 --------------E5A49E9E1F8AD6622815A742 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit


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
--------------E5A49E9E1F8AD6622815A742--