From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gnuemacser Newsgroups: gmane.lisp.guile.bugs Subject: bug#11456: add time.h in threads.c ,but it still don't work Date: Fri, 6 Jul 2012 21:26:26 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_8fd9dd76-fa82-41fe-8c9c-9992a5f943c2_" X-Trace: dough.gmane.org 1341581302 1933 80.91.229.3 (6 Jul 2012 13:28:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2012 13:28:22 +0000 (UTC) To: <11456@debbugs.gnu.org> Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jul 06 15:28:21 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sn8a0-0002RM-Qc for guile-bugs@m.gmane.org; Fri, 06 Jul 2012 15:28:17 +0200 Original-Received: from localhost ([::1]:52468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn8Zz-0006Ko-PP for guile-bugs@m.gmane.org; Fri, 06 Jul 2012 09:28:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn8Zw-0006KX-3H for bug-guile@gnu.org; Fri, 06 Jul 2012 09:28:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sn8Zp-0008TM-EF for bug-guile@gnu.org; Fri, 06 Jul 2012 09:28:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn8Zp-0008TI-B3 for bug-guile@gnu.org; Fri, 06 Jul 2012 09:28:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sn8ec-00051K-Py for bug-guile@gnu.org; Fri, 06 Jul 2012 09:33:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: gnuemacser Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 06 Jul 2012 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11456 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 11456-submit@debbugs.gnu.org id=B11456.134158152519203 (code B ref 11456); Fri, 06 Jul 2012 13:33:02 +0000 Original-Received: (at 11456) by debbugs.gnu.org; 6 Jul 2012 13:32:05 +0000 Original-Received: from localhost ([127.0.0.1]:51638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sn8dT-0004zH-Er for submit@debbugs.gnu.org; Fri, 06 Jul 2012 09:32:03 -0400 Original-Received: from col0-omc1-s4.col0.hotmail.com ([65.55.34.14]:60673) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sn8d3-0004yk-RE for 11456@debbugs.gnu.org; Fri, 06 Jul 2012 09:31:41 -0400 Original-Received: from COL108-W1 ([65.55.34.7]) by col0-omc1-s4.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 6 Jul 2012 06:26:26 -0700 X-Originating-IP: [222.67.217.48] Importance: Normal X-OriginalArrivalTime: 06 Jul 2012 13:26:26.0203 (UTC) FILETIME=[F1A766B0:01CD5B7A] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6412 Archived-At: --_8fd9dd76-fa82-41fe-8c9c-9992a5f943c2_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit i checked the libguile/scmconfig.h for scm_t_timespec /* same as POSIX "struct timespec" -- always defined */ typedef struct timespec scm_t_timespec; it seems normal. then i add #include in libguile/threads.c, but it still wrong. make all-am make[3]: Entering directory `/e/temp/files/guile/guile-2.0.5/build/libguile' CC libguile_2.0_la-threads.lo ../../libguile/threads.c: In function 'to_timespec': ../../libguile/threads.c:268:15: error: dereferencing pointer to incomplete type ../../libguile/threads.c:269:15: error: dereferencing pointer to incomplete type ../../libguile/threads.c:276:15: error: dereferencing pointer to incomplete type ../../libguile/threads.c:277:15: error: dereferencing pointer to incomplete type ../../libguile/threads.c: In function 'scm_cancel_thread': ../../libguile/threads.c:1166:7: warning: statement with no effect [-Wunused-value] ../../libguile/threads.c: In function 'scm_join_thread_timed': ../../libguile/threads.c:1230:18: error: storage size of 'ctimeout' isn't known ../../libguile/threads.c:1230:18: warning: unused variable 'ctimeout' [-Wunused-variable] ../../libguile/threads.c: In function 'fat_mutex_lock': ../../libguile/threads.c:1454:41: error: dereferencing pointer to incomplete type ../../libguile/threads.c:1455:36: error: dereferencing pointer to incomplete type ../../libguile/threads.c:1456:43: error: dereferencing pointer to incomplete type ../../libguile/threads.c: In function 'scm_lock_mutex_timed': ../../libguile/threads.c:1488:18: error: storage size of 'cwaittime' isn't known ../../libguile/threads.c:1488:18: warning: unused variable 'cwaittime' [-Wunused-variable] ../../libguile/threads.c: In function 'scm_try_mutex': ../../libguile/threads.c:1537:18: error: storage size of 'cwaittime' isn't known ../../libguile/threads.c:1537:18: warning: unused variable 'cwaittime' [-Wunused-variable] ../../libguile/threads.c: In function 'scm_unlock_mutex_timed': ../../libguile/threads.c:1680:18: error: storage size of 'cwaittime' isn't known ../../libguile/threads.c:1680:18: warning: unused variable 'cwaittime' [-Wunused-variable] ../../libguile/threads.c: In function 'scm_timed_wait_condition_variable': ../../libguile/threads.c:1784:18: error: storage size of 'waittime' isn't known ../../libguile/threads.c:1784:18: warning: unused variable 'waittime' [-Wunused-variable] make[3]: *** [libguile_2.0_la-threads.lo] Error 1 make[3]: Leaving directory `/e/temp/files/guile/guile-2.0.5/build/libguile' make[2]: *** [all] Error 2 make[2]: Leaving directory `/e/temp/files/guile/guile-2.0.5/build/libguile' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/e/temp/files/guile/guile-2.0.5/build' make: *** [all] Error 2 the error is very strange, several months ago ,i found this error . and not only mingw but also cygwin will get this error . i build guile-2.0.5 in slackware-current ,and it successed. i checked the source files like threads.h, scmconfig.h __scm.h _scm.h and pthread.h in mingw/include . i can't see why scmconfig.h will influence the threads.c. i do find the _scm.h has the relevance with threads.h. here is in _scm.h: /* Undefine HAVE_STRUCT_TIMESPEC, because the libguile C code doesn't need it anymore, and because on MinGW: - the definition of struct timespec is provided (if at all) by pthread.h - pthread.h will _not_ define struct timespec if HAVE_STRUCT_TIMESPEC is 1, because then it thinks that it doesn't need to. The libguile C code doesn't need HAVE_STRUCT_TIMESPEC anymore, because the value of HAVE_STRUCT_TIMESPEC has already been incorporated in how scm_t_timespec is defined (in scmconfig.h), and the rest of the libguile C code now just uses scm_t_timespec. */ #ifdef HAVE_STRUCT_TIMESPEC #undef HAVE_STRUCT_TIMESPEC #endif then i checked pthread.h in mingw/include ,it says: #ifdef _UWIN # define HAVE_STRUCT_TIMESPEC 1 # define HAVE_SIGNAL_H 1 # undef HAVE_PTW32_CONFIG_H # pragma comment(lib, "pthread") #endif ............................... #ifndef HAVE_STRUCT_TIMESPEC #define HAVE_STRUCT_TIMESPEC #ifndef _TIMESPEC_DEFINED #define _TIMESPEC_DEFINED struct timespec { time_t tv_sec; long tv_nsec; }; #endif /* _TIMESPEC_DEFINED */ #endif /* HAVE_STRUCT_TIMESPEC */ i can't understand :why all the declarations are ok ,but the gcc still don't know the struct scm_t_timespec --_8fd9dd76-fa82-41fe-8c9c-9992a5f943c2_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: 8bit
i checked the libguile/scmconfig.h for scm_t_timespec

/* same as POSIX "struct timespec" -- always defined */
typedef struct timespec scm_t_timespec;

it seems normal. then i add
#include <time.h>
in libguile/threads.c, but it still wrong.

make  all-am
make[3]: Entering directory `/e/temp/files/guile/guile-2.0.5/build/libguile'
  CC     libguile_2.0_la-threads.lo
../../libguile/threads.c: In function 'to_timespec':
../../libguile/threads.c:268:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c:269:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c:276:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c:277:15: error: dereferenci ng pointer to incomplete type
../../libguile/threads.c: In function 'scm_cancel_thread':
../../libguile/threads.c:1166:7: warning: statement with no effect [-Wunused-value]
../../libguile/threads.c: In function 'scm_join_thread_timed':
../../libguile/threads.c:1230:18: error: storage size of 'ctimeout' isn't known
../../libguile/threads.c:1230:18: warning: unused variable 'ctimeout' [-Wunused-variable]
../../libguile/threads.c: In function 'fat_mutex_lock':
../../libguile/threads.c:1454:41: error: dereferencing pointer to incomplete type
../../libguile/threads.c:1455:36: error: dereferencing pointer to incomplete type
../../libguile/threads.c:1456:43: error: dereferencing pointer to incomplete type
../../libguile/threads.c: In function 'scm_lock_mutex_timed' :
../../libguile/threads.c:1488:18: error: storage size of 'cwaittime' isn't known
../../libguile/threads.c:1488:18: warning: unused variable 'cwaittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_try_mutex':
../../libguile/threads.c:1537:18: error: storage size of 'cwaittime' isn't known
../../libguile/threads.c:1537:18: warning: unused variable 'cwaittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_unlock_mutex_timed':
../../libguile/threads.c:1680:18: error: storage size of 'cwaittime' isn't known
../../libguile/threads.c:1680:18: warning: unused variable 'cwaittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_timed_wait_condition_variable':
../../libguile/threads.c:1784:18: error: storage size of 'waittime' isn't known
../../libguile/threads.c:1784:18: warning: unused variable 'waittime' [-Wunused-variable]
make[3]: *** [libguile_2.0_la-threads.lo] Error 1
make[3]: Leaving directory `/e/temp/files/guile/guile-2.0.5/build/libguile'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/e/temp/files/guile/guile-2.0.5/build/libguile'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/e/temp/files/guile/guile-2.0.5/build'
make: *** [all] Error 2


the error is very strange, several months ago ,i found this error . and not only mingw but also cygwin will get this error .
i build guile-2.0.5 in slackware-current ,and it successed.
i checked the source files like threads.h, scmconfig.h __scm.h _scm.h and pthread.h in mingw/include . i can't see why scmconfig.h will influence the threads.c.
i do find the _scm.h has the relevance with threads.h. here is in _scm.h:
/* Undefine HAVE_STRUCT_TIMESPEC, because the libguile C code doesn't
   need it anymore, and because on MinGW:

   - the definition of struct timespec is provided (if at all) by
     pthread.h

   - pthread.h will _not_ define struct timespec if
     HAVE_STRUCT_TIMESPEC is 1, because then it thinks that it doesn't
     need to.

   The libguile C code doesn't need HAVE_STRUCT_TIMESPEC anymore,
   because the value of HAVE_STRUCT_TIMESPEC has already been
   incorporated in how scm_t_timespec is defined (in scmconfig.h), and
   the rest of the libguile C code now just uses scm_t_timespec.
 */
#ifdef HAVE_STRUCT_TIMESPEC
#undef HAVE_STRUCT_TIMESPEC
#endif

then i checked pthread.h in mingw/include ,it says:
#ifdef _UWIN
#   define HAVE_STRUCT_TIMESPEC 1
#   define HAVE_SIGNAL_H        1
#   undef HAVE_PTW32_CONFIG_H
#   pragma comment(lib, "pthread")
#endif

...............................

#ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC
#ifndef _TIMESPEC_DEFINED
#define _TIMESPEC_DEFINED
struct timespec {
        time_t tv_sec;
        long tv_nsec;
};
#endif /* _TIMESPEC_DEFINED */
#endif /* HAVE_STRUCT_TIMESPEC */

i can't understand :why all the declarations are ok ,but the gcc still don't know
the struct scm_t_timespec
--_8fd9dd76-fa82-41fe-8c9c-9992a5f943c2_--