From owner-freebsd-questions@FreeBSD.ORG Wed Jan 16 18:14:12 2013 Return-Path: Delivered-To: questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E4F7970 for ; Wed, 16 Jan 2013 18:14:12 +0000 (UTC) (envelope-from tomdean@speakeasy.org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id EAE24F8F for ; Wed, 16 Jan 2013 18:14:11 +0000 (UTC) Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.49]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 72ABBA71A6E for ; Wed, 16 Jan 2013 13:14:10 -0500 (EST) Received: (qmail 10677 invoked from network); 16 Jan 2013 18:14:09 -0000 Received: by simscan 1.4.0 ppid: 31143, pid: 25738, t: 0.1802s scanners: clamav: 0.88.2/m:52/d:10739 spam: 3.0.4 Received: from unknown (HELO [192.168.2.7]) (tomdean@[24.113.104.91]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 16 Jan 2013 18:14:09 -0000 Message-ID: <50F6EDFB.70501@speakeasy.org> Date: Wed, 16 Jan 2013 10:14:19 -0800 From: "Thomas D. Dean" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 Subject: Re: time_t definition References: <50F5A189.7000701@speakeasy.org> <20130116120015.3b8d0db4@mr129166> In-Reply-To: <20130116120015.3b8d0db4@mr129166> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail5.sea5 X-Spam-Level: * X-Spam-Status: No, score=1.4 required=8.0 tests=HOT_NASTY, RATWARE_GECKO_BUILD autolearn=disabled version=3.0.4 Cc: "questions@FreeBSD.org" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 18:14:12 -0000 On 01/16/13 03:00, Patrick Lamaiziere wrote: > Looks like gcc47 checks the printf format string (-Wformat) > Disable this check or convert your time_t. Yes, I know gcc47 checks the format string. But, time_t is of type int32, from a typedef statement. #include typedef int zzz; typedef zzz yyy; typedef yyy xxx; int main() { xxx idx; for (idx=0; idx<10; idx++) printf("%d\n",idx); return 0; } does not produce the error (I did this on the 'other' system) > gcc --version gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 ... > gcc -O2 -pipe -I../../include -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign xxx.c -o xxx I did not think to do this on the FreeBSD system I was using yesterday. What I don't understand is where gcc is losing track of this definition. In 9.0, or maybe earlier, the definition of time_t was changed with a view toward 64-bit systems. I remember a statement to the effect of "in 2038, 32-bit time will overflow. It is unlikely that many 32-biot systems will be around then. So, making the change to 64-bit now will prevent having to do it in the future". So, now, it seems that any calculation involving time_t requires a cast???? Tom Dean