Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 50798: /trunk/wiretap/ /trunk/wireta

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 22 Jul 2013 16:43:44 -0700
On Jul 22, 2013, at 2:23 PM, jmayer@xxxxxxxxxxxxx wrote:

> [  6%] Building C object wiretap/CMakeFiles/wiretap.dir/file_wrappers.c.o
> /home/jmayer/work/wireshark/svn/trunk/wiretap/file_wrappers.c:987:28: warning: implicit
>       conversion loses integer precision: 'gint64' (aka 'long long') to '__off_t'
>       (aka 'long') [-Wshorten-64-to-32]
>                 if (ws_lseek64(file->fd, off, SEEK_SET) == -1) {
>                     ~~~~~~~~~~           ^~~
> /home/jmayer/work/wireshark/svn/trunk/wiretap/file_wrappers.c:1051:35: warning:
>       implicit conversion loses integer precision: 'long long' to '__off_t' (aka 'long')
>       [-Wshorten-64-to-32]
>                 if (ws_lseek64(file->fd, offset - file->have, SEEK_CUR) == -1) {
>                     ~~~~~~~~~~           ~~~~~~~^~~~~~~~~~~~
> /home/jmayer/work/wireshark/svn/trunk/wiretap/file_wrappers.c:1076:34: warning:
>       implicit conversion loses integer precision: 'gint64' (aka 'long long') to
>       '__off_t' (aka 'long') [-Wshorten-64-to-32]
>                 if (ws_lseek64(file->fd, file->start, SEEK_SET) == -1) {
>                     ~~~~~~~~~~           ~~~~~~^~~~~


On UN*X (which I'm assuming it is), ws_lseek64() is #defined as lseek:

	#define ws_lseek64 lseek /* AC_SYS_LARGEFILE should make off_t 64-bit */

and, as the comment notes, we *should* be building with whatever flags etc. cause the "Large File Summit" features to be enabled, so that lseek()'s second argument is a signed 64-bit integer.

As "AC_SYS_LARGEFILE" implies, the "flags etc." are being set by AC_SYS_LARGEFILE when using autotools.  We need to do whatever the CMake equivalent of "please turn large file support on" is; if we're already doing that, it appears not to be working.  (I infer from "'gint64' (aka 'long long')" that this is a 32-bit build, and the 32-bit platforms are the ones where Large File Summit hackery is needed to support Large Files - well, except for 4.4-Lite-derived 32-bit platforms, where off_t is *always* 64-bit.)