[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr_off_t is of an ambiguous size.

From: Ben Reser <ben_at_reser.org>
Date: 2004-01-12 21:54:36 CET

On Mon, Jan 12, 2004 at 02:10:23AM -0800, Ben Reser wrote:
> b) At build time check to see if APR is using a 32-bit off_t or a 64-bit
> off_t (it could be 64-bit on some platforms). We can check this by
> looking at the APR_OFF_T_FMT define. If it's 32-bit enable bounds
> checking so we can throw an error if the value would surpass the bounds
> of what APR can handle. I don't think there'd be very many places we'd
> have to check for this. Only right before we passed one of these vars
> to an APR function. (Which as far as I can tell is only apr_file_seek
> right now).

*sigh* this is a little more complicated than I thought. Looking at the
APR_OFF_T_FMT isn't going to help by itself. Because on a 64 bit
platform "ld" and "lld" are both 64-bit formats. So I guess I'd have to
do the test on the size of a long AND APR_OFF_T_FMT.

If a long is 32-bits and the OFF_T_FMT is "ld" then we know we have a
32-bit off_t in APR and need to do bounds checking.

If OFF_T_FMT is "lld" or a long is 64-bits then off_t has to be a 64-bit

Ben Reser <ben@reser.org>
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 12 21:55:22 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.