Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2013 13:32:14 -0800
From:      "Thomas D. Dean" <tomdean@speakeasy.org>
Cc:        questions@freebsd.org
Subject:   Re: time_t definition
Message-ID:  <50F71C5E.9040207@speakeasy.org>
In-Reply-To: <201301161841.r0GIfgWS054810@mail.r-bonomi.com>
References:  <201301161841.r0GIfgWS054810@mail.r-bonomi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.  I/O format conversion is problematic.

In the simple example I posted, gcc did not complain of a format mismatch.

But, in the case of time_t gcc does complain of a format mismatch.

Both cases had the same number of typedef levels to get to a basic type
and used the same compile command.  Should have the same result...

I am attempting to understand the difference.

Tom Dean



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50F71C5E.9040207>