[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

warnings on amd64


Andreas,

The example you gave miscompile on 64 bits. %llu has a different semantic on 64bits (a long is a 64 bit value, I don't know for long long).

I'm not sure of a portable way of resolving this warning. Sure, we could pour %ld for arguments needing a long, but for the uint64_t, I don't know.

Could you have a look ?

Thanks,
Aris

home/aris/dev/libssh/sample.c: In function ‘do_sftp’:
/home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 5 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 6 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 7 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 8 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 9 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 10 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 11 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:359: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 12 has type ‘uint64_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 2 has type ‘long unsigned int’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘long unsigned int’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘__fsblkcnt_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 5 has type ‘__fsblkcnt_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 6 has type ‘__fsblkcnt_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 7 has type ‘__fsfilcnt_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 8 has type ‘__fsfilcnt_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 9 has type ‘__fsfilcnt_t’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 10 has type ‘long unsigned int’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 11 has type ‘long unsigned int’ /home/aris/dev/libssh/sample.c:390: attention : format ‘%llu’ expects type ‘long long unsigned int’, but argument 12 has type ‘long unsigned int’
Follow-Ups:
Re: warnings on amd64"Jean-Philippe Garcia Ballester" <giga@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org