cURL / Mailing Lists / curl-library / Single Mail


Re: Potential ABI break for libcurl Sun Compiler users

From: Stefan Teleman <>
Date: Thu, 2 Apr 2009 15:43:16 -0400

On Thu, Apr 2, 2009 at 14:58, Yang Tse <> wrote:
> Hi,
> Just a heads up for those using Sun compilers.
> I've just committed a change to CVS with the following description:
> Fix curl_off_t definition for builds done using Sun compilers and a
> non-configured libcurl. In this case curl_off_t data type was gated
> to the off_t data type which depends on the _FILE_OFFSET_BITS. This
> configuration is exactly the unwanted configuration for our curl_off_t
> data type which must not depend on such setting. This breaks ABI for
> libcurl libraries built with Sun compilers which were built without
> having run the configure script with _FILE_OFFSET_BITS different than
> 64 and using the ILP32 data model.

Earlier versions of curl [ at least as early as 7.15.5, which is what
I have handy ], explicitly typedef'ed curl_off_t to off_t in
${top_srcdir}/include/curl/curl.h. Moreover, the ./configure generated
config.h in 7.15.5 explicitly said


where <X> is whatever sizeof(curl_off_t) happened to be at ./configure
time. In 32-bit, sizeof(off_t) is either 4, or 8, depending on at
least one of the following being true:

1. _FILE_OFFSET_BITS=64 explicitly passed to the compiler
2. _LARGEFILE_SOURCE explicitly passed to the compiler
3. __EXTENSIONS__ is defined

It follows that earlier versions of CURL relied on the varying size of
the off_t datatype.

curl_off_t should continue being gated to the off_t type, which is
guaranteed to have the correct size for all possible compilation
environments, and which maintains ABI with earlier versions of CURL. C
compilation environments strictly conforming to the C Standard prior
to ISO/IEC 9899:1999 do not have the long long datatype.

Your patch breaks ABI with earlier versions of CURL.


Stefan Teleman
KDE e.V.
Received on 2009-04-02