GNU bug report logs - #14469
non-portable pthread in finalizers.c

Previous Next

Package: guile;

Reported by: Panicz Maciej Godek <godek.maciek <at> gmail.com>

Date: Sat, 25 May 2013 09:18:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14469 in the body.
You can then email your comments to 14469 AT debbugs.gnu.org in the normal way.

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#14469; Package guile. (Sat, 25 May 2013 09:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Panicz Maciej Godek <godek.maciek <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 25 May 2013 09:18:02 GMT) Full text and rfc822 format available.

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

From: Panicz Maciej Godek <godek.maciek <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: non-portable pthread in finalizers.c
Date: Sat, 25 May 2013 11:16:06 +0200
[Message part 1 (text/plain, inline)]
still hopelessly trying to build 2.0.9 on mingw,
using the up-to-date git master branch, and I keep
getting the following error:

finalizers.c: In function 'start_finalization_thread':
finalizers.c:259:7: error: wrong type argument to unary exclamation mark
finalizers.c: In function 'stop_finalization_thread':
finalizers.c:274:7: error: used struct type value where scalar is required
finalizers.c:279:27: error: incompatible types when assigning to type
'pthread_t' from type 'int'

here, the problem is that the code uses a non-portable feature of linux
pthreads, namely that pthread_t is implemented as an arithmetic type.
The manual page for pthread_self(3) states:

"POSIX.1 allows an implementation wide freedom in choosing the type used to
represent a thread ID; for example, representation using either an
arithmetic type or  a  structure  is  permitted.   Therefore, variables of
type pthread_t can't portably be compared using the C equality operator
(==); use pthread_equal(3) instead."

Mingw pthreads do make use of that freedom, and define pthread_t as a
struct, hence the code fails to compile.

As I browsed through bug-guile, and it seems to be a recurring issue, and
usually the proposed solution is to compile guile without threads, which is
not acceptable in my case.
[Message part 2 (text/html, inline)]

Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Thu, 30 May 2013 21:36:02 GMT) Full text and rfc822 format available.

Notification sent to Panicz Maciej Godek <godek.maciek <at> gmail.com>:
bug acknowledged by developer. (Thu, 30 May 2013 21:36:02 GMT) Full text and rfc822 format available.

Message #10 received at 14469-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Panicz Maciej Godek <godek.maciek <at> gmail.com>
Cc: 14469-done <at> debbugs.gnu.org
Subject: Re: bug#14469: non-portable pthread in finalizers.c
Date: Thu, 30 May 2013 23:33:28 +0200
Panicz Maciej Godek <godek.maciek <at> gmail.com> skribis:

> still hopelessly trying to build 2.0.9 on mingw,
> using the up-to-date git master branch,

The ‘master’ branch is “version 2.1”–i.e., the upcoming development
series for the future 2.2.

Guile 2.0.9 is part of the stable series and should not has this problem
on MinGW, so I would recommend using it.

> and I keep getting the following error:
>
> finalizers.c: In function 'start_finalization_thread':
> finalizers.c:259:7: error: wrong type argument to unary exclamation mark
> finalizers.c: In function 'stop_finalization_thread':
> finalizers.c:274:7: error: used struct type value where scalar is required
> finalizers.c:279:27: error: incompatible types when assigning to type
> 'pthread_t' from type 'int'
>
> here, the problem is that the code uses a non-portable feature of linux
> pthreads, namely that pthread_t is implemented as an arithmetic type.

Indeed.  Commit 1701a68 (in ‘master’) fixes that.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Jun 2013 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 298 days ago.

Previous Next


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