X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: octave configure on cygwin snapshot Date: Wed, 29 Aug 2007 16:31:58 +0000 (UTC) Lines: 69 Message-ID: References: <010e01c7ea38$d6cbd820$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <727852 DOT 30843 DOT qm AT web25003 DOT mail DOT ukl DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Marco Atzeri yahoo.it> writes: > Right assumption. This test is performed by configure > to verify is gettimeofday have one or 2 arguments. > As in the snapshot the program fail to compile, > configure wrongly assume that gettimeofday have only > one argument. I'm not sure of any platforms where it has only one parameter; more often, the portability problem is whether the parameter is void* (as required by POSIX) or something else (as was the case in cygwin 1.5.24). > On 1.5.24 the program compile fine an gettimeofday > is reported as function with two arguments. > > > > > > Why not show us the snippet of conftest.c that is > > triggering the error > > > message? > > OK, I see the problem now. Run the preprocessor on conftest.c: $ gcc -E conftest.c |grep -n -C2 timezone 440-}; 441- 442:struct timezone { 443- int tz_minuteswest; 444- int tz_dsttime; -- 817-__tzinfo_type *__attribute__((__cdecl__)) __gettzinfo (void); 818-# 118 "/usr/include/time.h" 3 4 819:extern __attribute__((dllimport)) long _timezone; 820-extern __attribute__((dllimport)) int _daylight; 821-extern __attribute__((dllimport)) char *_tzname[2]; -- 1168-# 73 "/usr/include/sys/time.h" 3 4 1169-int __attribute__((__cdecl__)) gettimeofday (struct timeval *__p, void *__tz); 1170:int __attribute__((__cdecl__)) settimeofday (const struct timeval *, const struct _timezone *); 1171-int __attribute__((__cdecl__)) utimes (const char *__path, const struct timeval *__tvp); 1172-int __attribute__((__cdecl__)) getitimer (int __which, struct itimerval *__value); -- 1178-{ 1179-struct timeval time; 1180: struct _timezone dummy; 1181- gettimeofday (&time, &dummy); 1182- ; Oops - this line in cygwin/time.h is causing the problem: #define timezone _timezone As your testcase shows, the inclusion of manages to define struct timezone, but then subsequent includes trigger the macro that changes the spelling to _timezone, and your declarations all end up referring to the incomplete type struct _timezone, hence the compiler error. So something in cygwin's headers needs to change in order to make sure struct timezone is not hidden by the macro in . A workaround in the meantime might be configuring with CFLAGS=-Dtimezone=_timezone. -- Eric Blake -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/