Re: time_t definition

2013-01-20 Thread Garance A Drosehn
On 1/16/13 1:14 PM, Thomas D. Dean wrote: 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.

Re: time_t definition

2013-01-20 Thread Michael Sierchio
On Sun, Jan 20, 2013 at 8:07 PM, Garance A Drosehn g...@freebsd.org wrote: Yes, this means that the only reliable way to printf a time_t is to use a cast. That has been true for at least a decade. It may be true that you happened to avoid this issue before, but the only *RELIABLE*

Re: time_t definition

2013-01-17 Thread Lowell Gilbert
Polytropon free...@edvax.de writes: On Wed, 16 Jan 2013 10:21:03 -0800, Michael Sierchio wrote: Top posting for brevity - the fact is, the code in your original example is wrong. There are reasons to complain about argument size mismatches, esp. in print functions that call (versions of)

Re: time_t definition

2013-01-17 Thread Polytropon
On Thu, 17 Jan 2013 09:24:27 -0500, Lowell Gilbert wrote: Polytropon free...@edvax.de writes: On Wed, 16 Jan 2013 10:21:03 -0800, Michael Sierchio wrote: Top posting for brevity - the fact is, the code in your original example is wrong. There are reasons to complain about argument size

Re: time_t definition

2013-01-17 Thread Thomas D. Dean
On 01/17/13 06:24, Lowell Gilbert wrote: A lot of discussion about what I can do other than understand why gcc does not keep track of the basic typedef. Mayhe the question is beyond this list. Thanks for the replies. Tom Dean ___

Re: time_t definition

2013-01-17 Thread Polytropon
On Thu, 17 Jan 2013 20:46:25 -0800, Thomas D. Dean wrote: A lot of discussion about what I can do other than understand why gcc does not keep track of the basic typedef. As explained, gcc issues a valid (!) warning because there was a type mismatch: You tried to printf() a (long) value with

Re: time_t definition

2013-01-16 Thread Patrick Lamaiziere
Le Tue, 15 Jan 2013 10:35:53 -0800, Thomas D. Dean tomd...@speakeasy.org a écrit : Hello, I am attempting to recompile some code from an older version. uname -a FreeBSD ZD7000 9.1-STABLE FreeBSD 9.1-STABLE #1: Sun Jan 13 23:44:33 PST 2013 root@ZD7000:/usr/obj/usr/src/sys/GENERIC

Re: time_t definition

2013-01-16 Thread Thomas D. Dean
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 stdio.h typedef int zzz; typedef

Re: time_t definition

2013-01-16 Thread Michael Sierchio
Top posting for brevity - the fact is, the code in your original example is wrong. There are reasons to complain about argument size mismatches, esp. in print functions that call (versions of) malloc. You should cast the time_t value explicitly, or use %d instead of %ld. - M On Wed, Jan 16,

Re: time_t definition

2013-01-16 Thread Robert Bonomi
Date: Wed, 16 Jan 2013 10:14:19 -0800 From: Thomas D. Dean tomd...@speakeasy.org Subject: Re: time_t definition 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

Re: time_t definition

2013-01-16 Thread Thomas D. Dean
On 01/16/13 10:41, Robert Bonomi wrote: *precisely* and the format string had %ld. this IS a type mismatch, if a 'long' is a 64-bit value. The original code was compiled on a 32-bit machine for a 32-bit target. I tried %d, %ld, and %lld with the same result. FALSE. Calculation is OK.

Re: time_t definition

2013-01-16 Thread Polytropon
On Wed, 16 Jan 2013 10:21:03 -0800, Michael Sierchio wrote: Top posting for brevity - the fact is, the code in your original example is wrong. There are reasons to complain about argument size mismatches, esp. in print functions that call (versions of) malloc. You should cast the time_t value

Re: time_t definition

2013-01-16 Thread Polytropon
On Wed, 16 Jan 2013 13:32:14 -0800, Thomas D. Dean wrote: On 01/16/13 10:41, Robert Bonomi wrote: *precisely* and the format string had %ld. this IS a type mismatch, if a 'long' is a 64-bit value. The original code was compiled on a 32-bit machine for a 32-bit target. I tried %d,

time_t definition

2013-01-15 Thread Thomas D. Dean
I am attempting to recompile some code from an older version. uname -a FreeBSD ZD7000 9.1-STABLE FreeBSD 9.1-STABLE #1: Sun Jan 13 23:44:33 PST 2013 root@ZD7000:/usr/obj/usr/src/sys/GENERIC i386 make gcc47 -O2 -pipe -I../../include -std=gnu99 -fstack-protector -Wsystem-headers