tpm2-tools branch master commit 3ab33f7
When configured with cmocka unit test enabled, GCC 5.4.0 complains about casting from integer to pointer (intergers and pointers might have different sizes in arm-linux-gnueabihf-gcc) :
CC test/unit/test_unit_test_tpm2_session-test_tpm2_session.o
test/unit/test_tpm2_session.c: In function ‘__wrap_Tss2_Sys_StartAuthSession’:
test/unit/test_tpm2_session.c:116:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
expected_data *e = (expected_data *) mock();
^
cc1: all warnings being treated as errors
GCC on Raspberry Pi 3 (target: arm-linux-gnueabihf)
$ ls -l `which arm-linux-gnueabihf-gcc`
lrwxrwxrwx 1 root root 5 Feb 11 2016 /usr/bin/arm-linux-gnueabihf-gcc -> gcc-5
$ ls -l `which gcc`
lrwxrwxrwx 1 root root 5 Feb 11 2016 /usr/bin/gcc -> gcc-5
# cd tpm2-tools && ./bootstrap && ./configure --enable-unit
CC=arm-linux-gnueabihf-gcc
CFLAGS='-Wall -Wextra -Werror=int-to-pointer-cast'
arm-linux-gnueabihf-gcc $CFLAGS -c test/unit/test_tpm2_session.c -I lib -I /usr/local/include/
test/unit/test_tpm2_session.c: In function ‘__wrap_Tss2_Sys_StartAuthSession’:
test/unit/test_tpm2_session.c:116:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
expected_data *e = (expected_data *) mock();
^
cc1: some warnings being treated as errors
tpm2-tools branch master commit 3ab33f7 When configured with cmocka unit test enabled, GCC 5.4.0 complains about casting from integer to pointer (intergers and pointers might have different sizes in arm-linux-gnueabihf-gcc) :
GCC on Raspberry Pi 3 (target: arm-linux-gnueabihf)
This also happened in tpm2-tss/abrmd, and has been solved by flihp with PR https://github.com/intel/tpm2-abrmd/pull/241, see issue https://github.com/intel/tpm2-abrmd/issues/239
Replace
with
would fix GCC warnings.