linux-msm / hexagonrpc

GNU General Public License v3.0
0 stars 1 forks source link

Compilation warnings with signed and unsigned integers #5

Open flamingradian opened 1 week ago

flamingradian commented 1 week ago

Originally reported on Gitlab:

While compiling 0.3.1 to test fastrpc on xiaomi-beryllium (sdm485-soc), I noted the follwing two warning messages:

[10/24] Compiling C object hexagonrpcd/hexagonrpcd.p/hexagonfs_mapped.c.o ../hexagonrpcd/listener.c: In function 'check_inbuf_sizes': ../hexagonrpcd/listener.c:115:25: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare] 115 | if (inbufs[0].s != 4 * (def->in_nums | ^~

20/24] Compiling C object tests/test_iobuffer.p/test_iobuffer.c.o ../libhexagonrpc/fastrpc.c: In function 'vfastrpc2': ../libhexagonrpc/fastrpc.c:224:25: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '3222295043' to '-1072672253' [-Woverflow] 224 | ret = ioctl(fd, FASTRPC_IOCTL_INVOKE, (__u64) &invoke); | ^~~~~~~~