e9a7dce599eb12d "printing: Define and use methods to fetch/store time in share cache" broke time32
Douglas Bagnall
douglas.bagnall at catalyst.net.nz
Tue Jan 20 23:18:08 UTC 2026
On 21/01/2026 11:06, Michael Tokarev via samba-technical wrote:
> Hi!
>
> When native time_t is 32bit, samba does not build anymore after
> commit e9a7dce599eb12d:
>
> source3/printing/printing.c:69:39: error: passing argument 3 of
> ‘tdb_fetch_int64’ from incompatible pointer type [-Wincompatible-
> pointer-types]
> 69 | if (tdb_fetch_int64(tdb, key, curr_time) != 0) {
> | ^~~~~~~~~
> | |
> | time_t * {aka long int *}
> note: expected ‘int64_t *’ {aka ‘long long int *’} but argument is of
> type ‘time_t *’ {aka ‘long int *’}
> 87 | int tdb_fetch_int64(struct tdb_context *tdb, const char
> *keystr, int64_t *);
> | ^~~~~~~~~
>
> The code assumes time_t is int64_t, which might not be the case.
>
> I guess an intermediate int64_t is needed here to pass to
> tdb_fetch_int64(), and next to assign it to *curr_time:
Yes.
Our CI has an environment called "debian11-samba-32bit" and I wondered
how we managed to pass that. The answer is by ignoring this warning:
>> 2026-01-20T21:39:06.344715Z 01O [3020/4920] Compiling source3/printing/printing.c
>> 2026-01-20T21:39:06.348312Z 01O [3021/4920] Linking bin/default/source4/rpc_server/libdcerpc-server-private-samba.so
>> 2026-01-20T21:39:06.369005Z 01O
>> 2026-01-20T21:39:06.369008Z 01O ==> /builds/samba-team/devel/samba/samba-32bit.stderr <==
>> 2026-01-20T21:39:06.369009Z 01O ../../source3/printing/printing.c: In function ‘fetch_share_cache_time’:
>> 2026-01-20T21:39:06.369010Z 01O ../../source3/printing/printing.c:69:32: warning: passing argument 3 of ‘tdb_fetch_int64’ from incompatible pointer type [-Wincompatible-pointer-types]
>> 2026-01-20T21:39:06.369014Z 01O 69 | if (tdb_fetch_int64(tdb, key, curr_time) != 0) {
>> 2026-01-20T21:39:06.369015Z 01O | ^~~~~~~~~
>> 2026-01-20T21:39:06.369015Z 01O | |
>> 2026-01-20T21:39:06.369016Z 01O | time_t * {aka long int *}
>> 2026-01-20T21:39:06.369016Z 01O In file included from ../../source3/include/util_tdb.h:27,
>> 2026-01-20T21:39:06.369017Z 01O from ../../source3/printing/printing.c:38:
>> 2026-01-20T21:39:06.369018Z 01O ../../source3/include/../../lib/util/util_tdb.h:87:66: note: expected ‘int64_t *’ {aka ‘long long int *’} but argument is of type ‘time_t *’ {aka ‘long int *’}
>> 2026-01-20T21:39:06.369043Z 01O 87 | int tdb_fetch_int64(struct tdb_context *tdb, const char *keystr, int64_t *);
>> 2026-01-20T21:39:06.369044Z 01O | ^~~~~~~~~
>> 2026-01-20T21:39:06.369045Z 01O
>> 2026-01-20T21:39:06.370852Z 01O
>> 2026-01-20T21:39:06.370853Z 01O ==> /builds/samba-team/devel/samba/samba-32bit.stdout <==
(from
https://cdn.artifacts.gitlab-static.net/d7/74/d774f54988aa2cb1f213a2c33407ff6a6b6e5e8de9a78fa29204f25918db3517/2026_01_20/12788977177/14647113759/job.log?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&response-content-disposition=inline&Expires=1768951196&KeyName=gprd-artifacts-cdn&Signature=qJkxB459PlWfUwU_4q-BkIPp0h0=
)
Douglas
More information about the samba-technical
mailing list