X-Spam-Check-By: sourceware.org Date: Fri, 27 Apr 2007 14:20:03 +0100 To: cygwin AT cygwin DOT com Subject: 1.5.24,XP: time.h + mrtd switch in gcc conflicting types Reply-To: a DOT r DOT lynas AT tees DOT ac DOT uk From: "Angel Robert Lynas" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.10 (Linux) 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 Cygwin version 1.5.24-2, gcc version 3.4.4 Windows XP Hi all. There seems to be an issue with "time.h" under some circumstances with a new Cygwin version. Using a simple test program ( called t.c): #include main() {} The problem arises when compilation is attempted with the -mrtd switch, the following errors arising: ------------------------------------ In file included from t.c:1: /usr/include/time.h:150: error: conflicting types for 'clock_getres' /usr/include/cygwin/time.h:20: error: previous declaration of 'clock_getres' was here /usr/include/time.h:150: error: conflicting types for 'clock_getres' /usr/include/cygwin/time.h:20: error: previous declaration of 'clock_getres' was here /usr/include/time.h:171: error: conflicting types for 'nanosleep' /usr/include/cygwin/time.h:18: error: previous declaration of 'nanosleep' was here /usr/include/time.h:171: error: conflicting types for 'nanosleep' /usr/include/cygwin/time.h:18: error: previous declaration of 'nanosleep' was here ------------------------------------ However the problem is absent from an earlier version of Cygwin (1.5.18 -- July 2005), as is the file /usr/include/cygwin/time.h (same version of gcc, though). Running the "program" under both versions with gcc's -M switch to show header dependencies revealed these differences at the end: ------------------------------------ $ diff headers headers-new 10,11c10,11 < /usr/include/signal.h /usr/include/sys/signal.h \ < /usr/include/cygwin/signal.h --- > /usr/include/endian.h /usr/include/cygwin/time.h /usr/include/signal.h\ > /usr/include/sys/signal.h /usr/include/cygwin/signal.h ------------------------------------ The newer version includes two new headers here, with an apparently surplus-to-requirements "time.h". Compilation without the switch produces no errors. Apologies for absence of a cygcheck output (not my machine). -- Angel Robert Lynas University of Teesside Formal Methods & Programming Research Group Room: T2.01A Tel: ext 3719 -- 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/